Skip to content

Commit 12c94f3

Browse files
authored
style-guide: add argument order suggestion (#18006)
1 parent 31c1034 commit 12c94f3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

contributing-guides/style-guide.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,23 @@ For example, `[d]ownload` in English may be translated into `[d]escargar` in Spa
434434
435435
## Example commands
436436

437+
### Argument order
438+
439+
Try to keep the following order:
440+
441+
- Program name
442+
- Input redirection from a file
443+
- All subcommands
444+
- Options/Flags
445+
- Positional arguments/Packages/Data/...
446+
- Output redirection to a file
447+
448+
For example: `systemctl < input_file.txt status --user pipewire > output_file.txt`
449+
450+
This is only a suggestion and should be disregarded when program functionality or readability dictates otherwise.
451+
452+
If the command does multiple things, try to keep the chronological order in which things happen.
453+
437454
### Option syntax
438455

439456
- For user-friendliness, prefer **GNU-style long options** (like `--help` rather than `-h`). Make sure that the options are cross-platform compatible (intended to work the same across multiple platforms) for pages in the `common` directory.

0 commit comments

Comments
 (0)