diff options
author | Anthony Wang | 2024-01-30 22:39:58 -0500 |
---|---|---|
committer | Anthony Wang | 2024-01-30 22:42:49 -0500 |
commit | 00d60c46204a072f5ed96d7498692f0b48cc8bc4 (patch) | |
tree | fdad265fd1955948ecdef102fb6acf5c8174ee92 /sd-add.fish | |
parent | a5bfafa8a7940be17ee059d50ddc3c77445ea3d6 (diff) |
Don't require -f flag for specifying file (adding -f won't hurt though), allow specifying sd-add card file as argv[1]
Diffstat (limited to 'sd-add.fish')
-rw-r--r-- | sd-add.fish | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sd-add.fish b/sd-add.fish index 69bb353..dd4eb62 100644 --- a/sd-add.fish +++ b/sd-add.fish @@ -1,5 +1,4 @@ function sd-add - set cardfile cards - set idx (math 1+(sqlite3 "$cardfile" "SELECT MAX(idx) FROM cards")) - sqlite3 "$cardfile" "INSERT INTO cards VALUES ($idx, 256, '$argv[1]', '$argv[2]')" + set idx (math 1+(sqlite3 "$argv[1]" "SELECT MAX(idx) FROM cards")) + sqlite3 "$argv[1]" "INSERT INTO cards VALUES ($idx, 256, '$argv[2]', '$argv[3]')" end |