Proper usage message

This commit is contained in:
Robert Bendun 2023-02-20 18:33:32 +01:00
parent 83ede4ef81
commit a7ed7a0d65
2 changed files with 16 additions and 13 deletions

View File

@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Builtin documentation for builtin functions display from repl and command line - Builtin documentation for builtin functions display from repl and command line.
- Suggestions which command line parameters user may wanted to use - Suggestions which command line parameters user may wanted to use
### Changed ### Changed

View File

@ -39,23 +39,26 @@ static unsigned repl_line_number = 1;
[[noreturn]] void usage() [[noreturn]] void usage()
{ {
std::cerr << std::cerr <<
"usage: musique <options> [filename]\n" "usage: musique [subcommand]...\n"
" where filename is path to file with Musique code that will be executed\n" " where available subcommands are:\n"
" where options are:\n" " run FILENAME\n"
" -c,--run CODE\n" " executes given file\n"
" executes given code\n"
" -I,--interactive,--repl\n"
" enables interactive mode even when another code was passed\n"
"\n" "\n"
" -f,--as-function FILENAME\n" " fun FILENAME\n"
" deffer file execution and turn it into a file\n" " load file as function\n"
"\n" "\n"
" --ast\n" " repl\n"
" prints ast for given code\n" " enter interactive enviroment\n"
"\n" "\n"
" -v,--version\n" " version\n"
" prints Musique interpreter version\n" " prints Musique interpreter version\n"
"\n" "\n"
" doc BUILTIN\n"
" print documentation for given builtin function\n"
"\n"
" help\n"
" prints this message\n"
"\n"
"Thanks to:\n" "Thanks to:\n"
" Sy Brand, https://sybrand.ink/, creator of tl::expected https://github.com/TartanLlama/expected\n" " Sy Brand, https://sybrand.ink/, creator of tl::expected https://github.com/TartanLlama/expected\n"
" Justine Tunney, https://justinetunney.com, creator of bestline readline library https://github.com/jart/bestline\n" " Justine Tunney, https://justinetunney.com, creator of bestline readline library https://github.com/jart/bestline\n"