You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hey, so I'm writing my todo program in cpp, and i accidentally pressed TAB after writing todo and my kitty terminal just crashed,
after some tinkering i've found that zsh uses --format in order to print the suggestions so naively i've tried this:
int main(int argc, char* argv[])
{
if ((argc > 3) && (string(argv[3]) == "--format")){
cout << "-h: show this menu";
cout << "-a: add to task list";
cout << "-r: remove task with index <idx>" << std::endl;
cout << "-t: toggle check/uncheck index <idx>" << std::endl;
cout << "-c: clear, remove all marked task (WIP)" << std::endl;
cout << "-f: toggle favorite index <idx>" << std::endl;
cout << "-e: edit task with index <idx>" << std::endl;
cout << "-j: export to json (backup) (WIP)" << std::endl;
cout << "-u: undo (WIP)" << std::endl;
return 0;
}
cout << "Welcome to my todo list program!\n";
...
but i've got some weird output like
❯ todo -u
--add -a -- add item
--all -A -- show all items
--backup -- backup database
--colour -- item color
XXXXXX
--version -- display version
-c -- clear, remove all marked task (WIP)
-e -- edit task with index <idx>
-f -- toggle favorite index <idx>
-h -- show this menu-a: add to task list-r: remove task with index <idx>
-j -- export to json (backup) (WIP)
-t -- toggle check/uncheck index <idx>
-u -- undo (WIP)
the XXX is to save space i had like 30 more lines there.
or when i change to
if ((argc > 3) && (string(argv[3]) == "--format")) {
cout << "-h : show this menu\n";
cout << "-a <tasks>: add <tasks> to task list\n";
cout << "-r <array>: remove task with index <idx>\n";
cout << "-t <array>: toggle check/uncheck index <idx>\n";
cout << "-c : clear, remove all marked task (WIP)\n";
cout << "-f <array>: toggle favorite index <idx>\n";
cout << "-e <idx> : edit task with index <idx>\n";
cout << "-j <path> : export to json (backup) (WIP)\n";
cout << "-u : undo (WIP)\n";
return 0;
}
i get
❯ todo
-h.-a<tasks> -- add <tasks> to task list
-h.-f<array>.-e<idx> -- edit task with index <idx>
-h.-f<array>.-j<path> -- export to json (backup) (WIP)
-h.-f<array>.-j<path>.-u -- undo (WIP)
-h.-f<array> -- toggle favorite index <idx>
-h.-r<array> -- remove task with index <idx>
.-h -- show this menu
-h.-t<array>.-c -- clear, remove all marked task (WIP)
-h.-t<array> -- toggle check/uncheck index <idx>
so my questions are
is why is that?
is adding some output like i did is a good way to support zsh-autocomplete?
where did the other commands of todo like --backup--all came from?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
hey, so I'm writing my todo program in cpp, and i accidentally pressed TAB after writing
todo
and my kitty terminal just crashed,after some tinkering i've found that
zsh
uses--format
in order to print the suggestions so naively i've tried this:but i've got some weird output like
the XXX is to save space i had like 30 more lines there.
or when i change to
i get
so my questions are
is why is that?
is adding some output like i did is a good way to support
zsh-autocomplete
?where did the other commands of todo like
--backup
--all
came from?thanks!
Beta Was this translation helpful? Give feedback.
All reactions