Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

added use command and change rm command #29

Merged
merged 2 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions completions/tasks.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# list of all available commands
set -l commands 'help' mklist rmlist ls cl add addAt rm show vi xdg
set -l commands 'help' mklist rmlist ls cl add addAt rm show vi xdg use
# command doesn't require files
complete -c tasks -f

Expand All @@ -20,15 +20,22 @@ complete -c tasks -n "not __fish_seen_subcommand_from $commands" \
-a "ls" -d "prints the name of available lists"
complete -c tasks -n "not __fish_seen_subcommand_from $commands" \
-a "cl" -d "use a particular list"
complete -c tasks -n "not __fish_seen_subcommand_from $commands" \
-a "use" -d "use a particular list"
complete -c tasks -n "not __fish_seen_subcommand_from $commands" \
-a "addAt" -d "adds task at given index"
complete -c tasks -n "not __fish_seen_subcommand_from $commands" \
-a "vi" -d "opens the to-do list in vi"
-a "vi" -d "opens the to-do sublist in vi"
complete -c tasks -n "not __fish_seen_subcommand_from $commands" \
-a "xdg" -d "opens the to-do list in default text editor"
-a "xdg" -d "opens the to-do sublist in default text editor"



# auto-complete for tasks use
complete -c tasks -n "__fish_seen_subcommand_from use"\
-a "(ls $HOME/.local/lib/tasks/lists)"

# auto-complete for tasks cl
complete -c tasks -n "__fish_seen_subcommand_from cl"\
-a "(ls $HOME/.local/lib/tasks/lists)"

Expand Down
Binary file modified manual/tasks.1.gz
Binary file not shown.
14 changes: 11 additions & 3 deletions manual/tasks.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Please refer Details for detailed explanation of some commands.

**show** : This command lists out all the tasks from to-do list along with the tasks that have been marked as done

**use** : This command is a substitute for cl command.

**vi** : This command opens the to-do list in vi.

**xdg** : This command opens the to-do list in default text editor.
Expand Down Expand Up @@ -98,13 +100,19 @@ deletes a task in the current list.
*Usage*
tasks rm \{KEYWORD\} \{-n INDEX\} \{\-\-hash=HASH\}
Atleast one of the parameters is important, if more than one is given, then the order of precedence is -n, \-\-hash, then KEYWORD.
**tasks rm .** : This command is used to clear the current list.
**tasks rm .** : This command is used to clear the current list which includes both sublists.
**tasks rm ** : This command is used to clear the "done" sublist.

***rmlist***
rmlist stands for remove list, it tears/delete a list
rmlist stands for remove list, it tears/delete a list.
*Usage*
tasks rmlist \[LIST NAME\]

***use***
use command is a substitute for the cl command.
*Usage*
tasks use \[LIST NAME\]

***vi***
opens the to-do list in vi
*Usage*
Expand All @@ -122,4 +130,4 @@ The list of all the known bugs can be found at <https://github.com/cmaspi/tasks/
You can check out <https://taskwarrior.org/> which is a feature-rich, multi-platform CLI to-do list management utility, but if you are looking for something more simple, make sure to checkout <https://stevelosh.com/projects/t/>.

# Copyright
Copyright (c) 2022 Chirag Mehta. MIT License : <https://opensource.org/licenses/MIT>. This is free software: you are free to change and redistribute it. There is NO WARRANTY OF ANY KIND.
Copyright (c) 2022 Chirag Mehta. MIT License : <https://opensource.org/licenses/MIT>. This is free software: you are free to change and redistribute it. There is NO WARRANTY OF ANY KIND.
10 changes: 8 additions & 2 deletions tasks
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ switch $cmd
end

# to switch to a list
case cl
case cl use
if test -n $argv[2]
set dir $tasksDir/lists/"$argv[2..-1]"
# echo $dir
Expand All @@ -96,7 +96,13 @@ switch $cmd
# this command is used to discard a task
case rm
if test -z $argv[2]
echo "tasks $argv[1] .. what?"
echo "This will clear the \"done\" sublist"
read -l -P 'Confirm [y]/n: ' confirm
switch $confirm
case N n
exit
end
cat /dev/null > $tasksDir/lists/"$list"/Tdone.txt
exit
end
if [ $argv[2] = "." ]
Expand Down