Skip to content

Commit f7791fa

Browse files
committed
Usage text should use the name of the executable instead of just "notes", in the case that the file is renamed to something else.
1 parent 46780ae commit f7791fa

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

notes

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -212,22 +212,23 @@ cat_note() {
212212
}
213213

214214
usage() {
215+
local name=$(basename $0)
215216
cat <<EOF
216-
notes is a command line note taking tool.
217+
$name is a command line note taking tool.
217218
218219
Usage:
219-
notes new|n <name> # Create a new note
220-
notes ls <pattern> # List notes by path
221-
notes find|f [pattern] # Search notes by filename and path
222-
notes grep|g <pattern> # Search notes by content
223-
notes search|s [pattern] # Search notes by filename or content
224-
notes open|o # Open your notes directory
225-
notes open|o <name> # Open a note for editing by full name
226-
notes rm [-r | --recursive] <name> # Remove note, or folder if -r or --recursive is given
227-
notes cat <name> # Display note
228-
echo <name> | notes open|o # Open all note filenames piped in
229-
echo <name> | notes cat # Display all note filenames piped in
230-
notes --help # Print this usage information
220+
$name new|n <name> # Create a new note
221+
$name ls <pattern> # List notes by path
222+
$name find|f [pattern] # Search notes by filename and path
223+
$name grep|g <pattern> # Search notes by content
224+
$name search|s [pattern] # Search notes by filename or content
225+
$name open|o # Open your notes directory
226+
$name open|o <name> # Open a note for editing by full name
227+
$name rm [-r | --recursive] <name> # Remove note, or folder if -r or --recursive is given
228+
$name cat <name> # Display note
229+
echo <name> | $name open|o # Open all note filenames piped in
230+
echo <name> | $name cat # Display all note filenames piped in
231+
$name --help # Print this usage information
231232
232233
'command|c' means you can use 'command' or the equivalent shorthand alias 'c'
233234

0 commit comments

Comments
 (0)