Skip to content

Conversation

@sebastiancarlos
Copy link

@sebastiancarlos sebastiancarlos commented Nov 28, 2023

Hello,

For my personal use, I updated the --help output to clarify a bit the behavior (particularly highlighting the importance of putting everything compiler-related in the first argument, and the need for a final -- in that argument when used as a shebang.

Current --help:

Usage: c <file.c ... | compiler_options ...> [program_arguments]
       c --clear-cache
Execute C programs from the command line.

  Ex: c main.c
  Ex: c main.c arg1 arg2
  Ex: c 'main.c other.c' arg1 arg2
  Ex: c 'main.c -lncurses' arg1 arg2

This PR's --help:

Usage:
       c '<file.c ... | compiler_options ...>' [program_arguments]
       c --clear-cache

Usage for shebang with extra compiler options:
       c '<other.c ... | compiler_options ...> --' <file.c> [program_arguments]

Execute C programs from the command line.

  Ex: c main.c
  Ex: c main.c arg1 arg2
  Ex: c 'main.c other.c' arg1 arg2
  Ex: c 'main.c -lncurses' arg1 arg2

Execute C programs when "main.c" is executable with shebang.

  Shebang: #!/usr/bin/env c
  Shebang: #!/usr/bin/env -S c 'other.c --'
  Shebang: #!/usr/bin/env -S c '-lncurses --'
  Ex:      ./main.c
  Ex:      ./main.c arg1 arg2

Feel free to merge if you like it. Cheers!

Imran-imtiaz48

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants