Skip to content

Commit

Permalink
Quartz sync: Feb 11, 2024, 12:39 AM
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaGit committed Feb 11, 2024
1 parent 3b4ad7c commit da963b7
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 44 deletions.
6 changes: 3 additions & 3 deletions content/mac/Apple Photos Sync Log.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Apple Photos Sync Log
tags:
- macOS
- apple
- command line
- macOS
- apple
- command_line
---
This command line snippet shows the progress of the internals of the iCloud sync log:

Expand Down
8 changes: 4 additions & 4 deletions content/mac/Fixing high CPU usage by Spotlight.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Fixing high CPU usage by Spotlight
tags:
- command line
- troubleshooting
- macos
- spotlight
- troubleshooting
- macos
- spotlight
- command_line
---

Sometimes the spotlight process (particularly the `corespotlightd` process), so this is how it can be fixed without a full reinstall ([source](https://developer.apple.com/forums/thread/675482), answer by coinspiranted).
Expand Down
4 changes: 2 additions & 2 deletions content/projects/dotfiles.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: dotfiles
tags:
- command line
- projects
- projects
- command_line
---

It's very common for developers to create their own "dotfiles" project. This is, a project with the default configurations for consoles and other tools, which is usually stored in files starting with a dot (hence the name).
Expand Down
6 changes: 3 additions & 3 deletions content/security/Kubectl Snippets.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Kubectl snippets
tags:
- kubernetes
- command line
- snippets
- kubernetes
- snippets
- command_line
---

For the alias, see my [[dotfiles]] project.
Expand Down
90 changes: 90 additions & 0 deletions content/tools/Command line interface guidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
title: Command line interface guidelines
tags:
- command_line
- guidelines
---
- Basics
- Use a command-line argument parsing library where you can.
- Return zero exit code on success, non-zero on failure.
- Send output to `stdout`.
- Send error messaging to `stderr`, (not to `stdout`)
- Help
- Display help text when passed no options, the `-h` flag, or the `--help` flag.
- Concise text help by default.
- Full help when the flags are passed.
- Ignore all other parameters when the flags are passed.
- Include examples
- Documentation
- Provide web-based documentation.
- Consider providing man pages.
- Output
- Human-readable output is paramount.
- If human-readable output breaks machine-readable output, use `--plain` to display output in plain, tabular text format.
- Display output as formatted JSON if `--json` is passed.
- Display output on success, but keep it brief.
- If you change state, tell the user.
- Actions crossing the boundary of the program’s internal world should usually be explicit.
- Disable color if your program is not in a terminal or the user requested it.
- Errors
- Catch errors and rewrite them for humans.
- Arguments and flags
- Prefer flags to args.
- Have full-length versions of all flags.
- Use standard names for flags, if there is a standard. Common ones:
- `-a`, `--all`
- `-d`, `--debug`
- `-f`, `--force`
- `--json`
- `-h`, `--help`
- `--no-input`
- `-o`, `--output-file`
- `-p`, `--port`
- `-q`, `--quiet`
- `-u`, `--user`
- `-v`, `--version` or `--verbose`
- Make the default the right thing for most users.
- Confirm before doing anything dangerous.
- If input or output is a file, support `-` to read from `stdin` or write to `stdout`.
- If a flag can accept an optional value, allow a special word like “none.”
- If possible, make arguments, flags and subcommands order-independent.
- Do not read secrets directly from flags.
- Interactivity
- If `--no-input` is passed, don’t prompt or do anything interactive.
- If you’re prompting for a password, don’t print it as the user types.
- Let the user escape.
- Subcommands
- Be consistent across subcommands.
- Don’t have ambiguous or similarly-named commands.
- Robustness
- Validate user input.
- Responsive is more important than fast.
- Show progress if something takes a long time.
- Future-proofing
- Keep changes additive where you can.
- Warn before you make a non-additive change.
- Signals and control characters
- If a user hits Ctrl-C (the INT signal), exit as soon as possible.
- Configuration
- Follow the [XDG-spec](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).
- Environment variables
- Environment variable names must only contain uppercase letters, numbers, and underscores (and mustn’t start with a number).
- Check general-purpose environment variables for configuration values when possible. Common ones:
- `NO_COLOR`, `FORCE_COLOR`
- `DEBUG`
- `EDITOR`
- `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY` and `NO_PROXY`
- `SHELL`
- `TERM`, `TERMINFO` and `TERMCAP`
- `TMPDIR`
- `HOME`
- `PAGER`
- `LINES` and `COLUMNS`
- Naming
- Make it a simple, memorable word.
- Use only lowercase letters, and dashes if you really need to.
- Keep it short.

## Sources

- [Command Line Interface Guidelines](https://clig.dev/)
8 changes: 4 additions & 4 deletions content/tools/Command line snippets.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Command line snippets
tags:
- command line
- snippets
- bash
- zsh
- snippets
- bash
- zsh
- command_line
---

## Delete files smaller than a certain size
Expand Down
10 changes: 5 additions & 5 deletions content/tools/Docker snippets.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Docker snippets
tags:
- tools
- docker
- command line
- containers
- snippets
- tools
- docker
- containers
- snippets
- command_line
---

Useful docker snippets for the delight of every day use.
Expand Down
4 changes: 2 additions & 2 deletions content/tools/Uploading files to AWS instances.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Uploading files to AWS instances
tags:
- aws
- command line
- aws
- command_line
---

```bash
Expand Down
6 changes: 3 additions & 3 deletions content/tools/curl.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: curl
tags:
- tools
- unix
- command line
- tools
- unix
- command_line
---

**curl** is an amazing tool to perform HTTP calls.
Expand Down
8 changes: 4 additions & 4 deletions content/tools/git aliases oh my zsh.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: git aliases within oh my zsh
tags:
- zsh
- command line
- git
- tools
- zsh
- git
- tools
- command_line
---

https://kapeli.com/cheat_sheets/Oh-My-Zsh_Git.docset/Contents/Resources/Documents/index
8 changes: 4 additions & 4 deletions content/tools/git snippets.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: git snippets
tags:
- git
- tools
- command line
- snippets
- git
- tools
- snippets
- command_line
---

## Amending changes in a commit without modifying the message
Expand Down
6 changes: 3 additions & 3 deletions content/tools/grep.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: grep
tags:
- tools
- unix
- command line
- tools
- unix
- command_line
---

Find a string in all files of a folder ([source](https://stackoverflow.com/a/13908492/147507)):
Expand Down
6 changes: 3 additions & 3 deletions content/tools/iterm2 notifications.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: iterm2 notifications
tags:
- tools
- automation
- command line
- tools
- automation
- command_line
---

We can get different triggers for post notifications when certain events happen in iterm2.
Expand Down
8 changes: 4 additions & 4 deletions content/tools/zip snippets.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: zip snippets
tags:
- zip
- command line
- unix
- snippets
- zip
- unix
- snippets
- command_line
---

Compressing a directory recursively but leaving some files/directories aside ([source](https://superuser.com/a/312302)):
Expand Down

0 comments on commit da963b7

Please sign in to comment.