Hacker News new | ask | show | jobs
by deathbyzen 6478 days ago
1)Why require brackets? They seem superfluous. Unless theres something in the design of your code that requires them, I see them doing no good. 2)Shorthand versions of commands. "wiki stargate" instead of "wikipedia stargate" 3) The UI is nice. It took me a second to realize it wasn't a plug-in/extension like Ubiquity, but I had to type in commands at the bottom.

What are you reasons for making this app? I like it, but I can't see myself using it every day.

1 comments

Thanks for asking :)

Adding the brackets greatly simplifies things for the implementation of the command dispatcher/suggester. In addition, in some situations it can be difficult tell what part of the command is an input and what isn't.

For example, let's say a user intends to use the command: translate [text] to [language]

They type:

translate hey buddy! i found this neat guide to japanese

There are two ways to interpret this, both of which are valid:

1. The user typed a full command.

Bracketed version:

translate [hey buddy! i found this neat guide] to [japanese]

2. The user isn't finished writing the text to be translated, and should get a list of suggestions.

Bracketed version:

translate [hey buddy! i found this neat guide to japanese]

I made this app because traditional command lines are often tricky to use. I don't enjoy looking up documentation for each and every command argument.

With this method, you get suggestions at every step of the way (try typing "films starring [").

You could make brackets optional. And change them to quotes:

  translate serendipity to french
  translate "go after" to french
Read the curses library implementation. You might find it useful.
Hi :] What part of it would be useful?