diff --git a/README.md b/README.md index fd33122..535db84 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,7 @@ set an env variable for $EDITOR and/or $VISUAL in .bashrc export EDITOR=vi export VISUAL=geany -## Usage: - +## Usage `skratch` creates a random file in .skratch and opens it in the EDITOR `` opens or creates a file with a specific name in ~/.skratch @@ -25,6 +24,4 @@ set an env variable for $EDITOR and/or $VISUAL in .bashrc `-l` lists files in ~/.skratch -`-s` adds a suffix to the file - `-v` uses the VISUAL editor diff --git a/skratch.py b/skratch.py index deedef1..7781734 100755 --- a/skratch.py +++ b/skratch.py @@ -39,11 +39,11 @@ def get_editor(use_v): return v return e -def run(editor, sk_path, filename=None, f_suffix=""): +def run(editor, sk_path, filename=None): if not filename: t = time.localtime() filename = f"skratch-{t.tm_year}-{t.tm_mon}-{t.tm_mday}-" - fd, fp = tempfile.mkstemp(prefix=filename, dir=sk_path, suffix=f_suffix) + fd, fp = tempfile.mkstemp(prefix=filename, dir=sk_path) os.close(fd) else: fp = os.path.join(sk_path, filename) @@ -77,11 +77,6 @@ def main(): help="list files", action="store_true") - group.add_argument( - "-s", - help="add suffix", - action="store") - parser.add_argument( "-v", help="visual editor", @@ -92,6 +87,6 @@ def main(): editor = get_editor(args.v) if args.c: delete_all(sk_path) elif args.l: list_all(sk_path) - else: run(editor,sk_path, args.filename, args.s) + else: run(editor,sk_path, args.filename) main()