rust-cli / rust-cli/book

Book: Chapter on "writing robust CLI applications"

Open
#53 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.1k
Forks
122
Avg merge
10h 37m
Merged PRs (30d)
2

Description

Inspired by @vorner's comment (https://github.com/rust-lang-nursery/cli-wg/pull/105#discussion_r240003491).

We should look into adding an in-depth chapter on how to write applications in a robust and well-behaved way. For example, when an application was forcefully terminated (kill -9, power outage, …), it should still be possible to start it again without any issues.

For this to work, several aspects need to be considered. For example,

  • cleaning up or overwriting temporary files from a previous run without issues
  • atomically writing config files so they are not corrupted

Other "robustness" aspects that come to mind:

  • Follow sane resource limits for the current OS (e.g. not open millions of file descriptors on macOS)
  • Try to be both forward and backward compatible with config files and CLI arguments

Noe: As @vorner correctly pointed out, this does not need to be specific to CLI applications!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No target file or test is named. Review the book's existing chapter structure and the linked pull request discussion first, then define the chapter scope around the listed robustness topics. Done means the agreed in-depth guidance is added to the book and fits its existing organization.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.