mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 21:52:12 +01:00
Add -d/--cheat_directories option to list directories containing cheatsheets
This commit is contained in:
parent
437f191bf7
commit
5c51f457a0
1 changed files with 5 additions and 1 deletions
6
cheat
6
cheat
|
@ -121,7 +121,11 @@ def main():
|
||||||
|
|
||||||
# create/edit option
|
# create/edit option
|
||||||
option = sys.argv[1].lower()
|
option = sys.argv[1].lower()
|
||||||
if option in ['-e', '--edit', '-c', '--create']:
|
if option in ['-e', '--edit', '-c', '--create', '-d', '--cheat_directories']:
|
||||||
|
# list cheat directories and exit
|
||||||
|
if option in ['-d', '--cheat_directories']:
|
||||||
|
print(' '.join(cheat_directories()))
|
||||||
|
exit()
|
||||||
# make sure EDITOR environment variable is set and that at least 3 arguments
|
# make sure EDITOR environment variable is set and that at least 3 arguments
|
||||||
# are given
|
# are given
|
||||||
if 'EDITOR' not in os.environ:
|
if 'EDITOR' not in os.environ:
|
||||||
|
|
Loading…
Reference in a new issue