use -- style command options
This commit is contained in:
parent
206ab23e36
commit
f4a1f4f251
@ -10,8 +10,8 @@ pip install --user terminis
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
terminis [edit|help|n]
|
terminis [--edit|--help|n]
|
||||||
```
|
```
|
||||||
* edit: edit controls in text editor
|
* --edit: edit controls in text editor
|
||||||
* help: show command usage
|
* --help: show command usage
|
||||||
* n (integer between 1 and 15): start at level n
|
* n (integer between 1 and 15): start at level n
|
||||||
|
@ -719,10 +719,10 @@ class Game:
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if "edit" in sys.argv[1:]:
|
if "--edit" in sys.argv[1:]:
|
||||||
edit()
|
edit()
|
||||||
elif "help" in sys.argv[1:]:
|
elif "--help" in sys.argv[1:] or "/?" in sys.argv[1:]:
|
||||||
usage()
|
print_help()
|
||||||
else:
|
else:
|
||||||
curses.wrapper(Game)
|
curses.wrapper(Game)
|
||||||
|
|
||||||
@ -735,11 +735,11 @@ def edit():
|
|||||||
else:
|
else:
|
||||||
subprocess.call(["${EDITOR:-vi}", Controls.FILE_PATH])
|
subprocess.call(["${EDITOR:-vi}", Controls.FILE_PATH])
|
||||||
|
|
||||||
def usage():
|
def print_help():
|
||||||
print("Usage:")
|
print("Usage:")
|
||||||
print("python terminis.py [edit|help|n]")
|
print("python terminis.py [--edit|--help|n]")
|
||||||
print(" edit: edit controls in text editor")
|
print(" --edit: edit controls in text editor")
|
||||||
print(" help: show command usage (this message)")
|
print(" --help: show command usage (this message)")
|
||||||
print(" n (integer between 1 and 15): start at level n")
|
print(" n (integer between 1 and 15): start at level n")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user