Background
I'm designing a command-line API to a HPC Cluster (it API might eventually be published over the web as well).
The question
I wonder what would be the be the recommended strategy for emulating REST "end-points" on the command-line.
I can see two options:
- Use a separate command/scriptfile/binary, for each endpoint, with command line flags only for filtering and selecting output format (when other than default). An endpoint for "projects", would then be a separate command, in some folder, so that you would execute it with
myrestfulcliapi/projects [optional other flags]
- Use a single command/script-file/binary, and select endpoint with a command-line flag, so that one endpoint might be executed with
myrestfulcliapi --endpoint=projects [optional other flags]
If there are no established best practices for this, what pros and cons do you see with the respective options (technically, conceptually, or in any other aspect), and which one would you recommend?