👩‍❤️‍💋‍👩 Synchronize installed packages on multiple machines

Overview

emplace

Command-line tool to mirror installed software on multiple machines.

Build Status Downloads Version


Features

  • Outputs a human-readable (RON) file to sync between machines: .emplace

  • Version control with git to automatically push & pull updates

  • Automatic prompt after installing a package

  • Integrates well with dotfiles repositories

  • Parses history file

  • Package managers supported:

    OS Package Manager
    Apt
    GNU Guix
    Nix
    Pacman
    RUA
    Yay
    Snap
    DNF/YUM
    Homebrew
    Pkg
    Chocolatey
    Scoop
    Cargo
    Rustup Component
    Python Pip
    Python Pip 3
    Node Package Manager
    Ruby Gem
    Go
  • Shells supported:

    Shell
    Bash
    Zsh
    Fish
    Nu

Installation Packaging status

Getting Started

  1. Install the emplace binary:

    Windows

    Scoop

    scoop install emplace

    NixOS

    nix-env -iA nixos.emplace

    Linux, MacOS, Windows

    Rust

    cargo install emplace

    Binary

    Download the latest binary from releases for your OS and put it somewhere in your PATH.

  2. Add the init script to your shell's config file:

    Bash

    Add the following to the end of ~/.bashrc:

    # ~/.bashrc
    
    source <(emplace init bash)

    Zsh

    Add the following to the end of ~/.zshrc:

    # ~/.zshrc
    
    eval "$(emplace init zsh)"

    Fish

    Add the following to the end of ~/.config/fish/config.fish:

    # ~/.config/fish/config.fish
    
    emplace init fish | source

    Nu

    Run the following in your shell:

    emplace init nu | config set_into prompt
  3. Change the configuration file (optional)

    When you want to use a different configuration file from the default one you can change emplace init $SHELL with emplace init $SHELL -c path/to/my/config.toml.

    This will set the EMPLACE_CONFIG="path/to/my/config.toml" environment variable. This can be overwritten with export EMPLACE_CONFIG="path/to/other/config.toml" after the init function, except in the Nu shell.

Usage

Mirroring Packages

Invoke the supported package manager of choice using the command line in a normal way and you will automatically be prompted to mirror the package, for example:

cargo install topgrade
# -- or --
rustup component add rustfmt
# -- or --
sudo apt install meld
# -- or --
pacman -S zsh
# -- or --
rua install peek
# -- or --
yay -S thunar
# -- or --
sudo snap install scrcpy
# -- or --
npm install -g release
# -- or --
pip3 install --user termtosvg
# -- or --
choco install neovim
# -- or --
scoop install curl
# -- or --
nix-env -iA nixpkgs.nixfmt
# -- or --
brew install wget
# -- or --
sudo dnf install htop
# -- or --
guix install 0ad
# -- or --
gem install aasm-diagram
# -- or --
go get colorgo
# -- or --
pkg install nginx

Synchronizing On Another Machine

Just invoke emplace install, and you will be prompted with the packages to install:

emplace install

History Analysis

You can also parse history files, this will try to extract installation commands from each line.

Bash & Zsh

emplace history $HISTFILE

Fish

emplace history ~/.local/share/fish/fish_history

Removing Synchronized Packages

Run emplace clean and select the packages you want to be cleaned, they won't be removed from your system.

Creating and modifying config files

Run emplace config --new to create a new config and configure the repository or emplace config --path to retrieve the path to the configuration file.

Contributors

Thanks goes to these wonderful people (emoji key):


Logan Magee

💻 🐛

Vladimir

📦 💻 🐛 🚧 👀

Jozef Hollý

🤔

Oleksii Filonenko

💻 📦 👀

x0f5c3

💻

Benjamin S. Leveritt

🤔 🚧

Michael Borejdo

🤔

Ken Tobias

📦

Adam Stephens

🐛

omar

🐛

5c0tt-b0t

🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

Comments
  • Perfomance improvement

    Perfomance improvement

    Now, most of the time is spent in git related operations. So i think, we need to rework this module. Maybe make git operations async, or do not git pull on every command execution

    opened by 0xdeafbeef 25
  • [BUG]

    [BUG]

    Describe the bug First run doesn't work. It doesn't initialize .emplace file and painics after this. To Reproduce Steps to reproduce the behavior: Do everything like in readme. Note, emplace is modified for extended logging

    16:57:37 [ INFO] Cloning repo "https://github.com/username/emplace_storage" to "/home/username/.local/share/emplace".
    16:57:39 [ INFO] Config full path: "/home/username/.local/share/emplace/.emplace"
    16:57:39 [ INFO] Config: Config { repo_directory: "/home/username/.local/share/emplace", repo: RepoConfig { url: "https://github.com/username/emplace_storage", branch: "master", file: ".emplace" } }
    thread 'main' panicked at 'Could not read packages file from repository: failed opening Emplace mirrors file
    

    It cannot read file, because it isn't created, because it's a first run. Maybe it should manually create it and place empty vec to it, but it seems to be a strange design.

    bug 
    opened by 0xdeafbeef 18
  • Add Cargo.lock

    Add Cargo.lock

    This is an executable, so it makes sense to have it checked in. Repositories like NixOS/nixpkgs require Cargo.lock to be present in order to package the software.


    This change is Reviewable

    opened by Br1ght0ne 11
  • [BUG] package_manager_impl.is_available() produces false negatives

    [BUG] package_manager_impl.is_available() produces false negatives

    Describe the bug I am using emplace on Windows 10 currently. I want to manage npm, scoop and cargo packages. Currently emplace does not recognize these managers, because is_available returns always false. I narrowed it down to is_executable returning false, when the commands-Vector does not include ".exe". For scoop there does not seem to be an executable in PATH (just a cmd file). is_executable does not seem to return true here neither.

    Desktop (please complete the following information):

    • OS: Windows 10
    • Shell: nushell (same in cmd)
    bug 
    opened by mborejdo 8
  • Big refactor

    Big refactor

    Changes:

    • Every package manager has its own file in src/package_manager/. All you have to do to create a new one is copy another, change the values & add it to src/package_manager/mod.rs.
    • .emplace file now has a field for flags and a slightly different format.
    • Old .emplace files are automatically migrated to the new version.
    • PipUser and Pip3User are not used anymore, they are handled by Pip & Pip3 with flags.
    • Rename RustupComponent to Rustup.
    • The Regex parser is replaced by a manual parser which is generic.
    • Default console output is a regular print instead of a info! which prints a timestamp.

    TODO for this PR:

    • [x] ~Implement prefix for commands (Nix).~
    • [x] Support non-determined flag values (Nix).
    • [x] Support sub commands with multiple arguments (Rustup).

    TODO later:

    • [ ] Check for the command in the path instead of executing it (#56).
    • [ ] Add known flags with values for Pacman.
    • [ ] Add known flags with values for Pip.
    • [ ] Add known flags with values for Pip3.
    • [ ] Add known flags with values for Yay.
    • [ ] Add known flags with values for Snap.
    • [ ] Add known flags with values for Npm.
    • [ ] Add known flags with values for Nix.
    • [ ] Add known flags with values for Rua.
    • [ ] Add known flags with values for Chocolatey.
    • [ ] Add known flags with values for Scoop.
    opened by tversteeg 8
  • Fix polling of installtion programm. Fix yay

    Fix polling of installtion programm. Fix yay

    Checking, that package manager is installed was donein strange way.
    For example, checking, that yay is installed will produce n [sudo] password for username:, where n is number of pakages to install. In addition, fixed some issues with yay.

    opened by 0xdeafbeef 8
  • [BUG] emplace install for scoop-packages fails

    [BUG] emplace install for scoop-packages fails

    Describe the bug Installing scoop-packages currently fails due to an incorrectly generated install-command [ERROR] "sudo scoop install package": The system cannot find the file specified. (os error 2) returning false in scoop-mngrs needs_root imlementation generates the correct command, but still scoop is not being found: [ERROR] "scoop install package": The system cannot find the file specified. (os error 2)

    Desktop (please complete the following information):

    • OS: Windows 10
    • Shell: nushell

    Additional context the scoop command is not an executable, so maybe this is the problem here

    bug 
    opened by mborejdo 7
  • [BUG] emplace asks to mirror when starting a new shell while install in progress

    [BUG] emplace asks to mirror when starting a new shell while install in progress

    Describe the bug If an install is in progress in shell-1, creating a new shell will initiate the emplace mirror prompt in shell-2 before anything has been done.

    To Reproduce Steps to reproduce the behavior:

    1. shell-1: brew install qt-creator # which takes a long time to download
    2. open shell-2

    Expected behavior New shells should not prompt regarding actions started in a different shell

    Desktop (please complete the following information):

    • OS: Linux
    • Shell: zsh

    Machine information

    Software version

    emplace 1.4.0

    Operating system

    Darwin 20.3.0

    Environment variables

    SHELL=/run/current-system/sw/bin/zsh
    EMPLACE_CONFIG='/Users/john.vandenberg/Library/Application Support/emplace.toml'
    

    Git version

    > git --version
    git version 2.31.0
    

    Compile time information

    • Profile: release
    • Target triple: x86_64-apple-darwin
    • Family: unix
    • OS: macos
    • Architecture: x86_64
    • Pointer width: 64
    • Endian: little
    • CPU features: fxsr,sse,sse2,sse3,ssse3
    • Host: x86_64-apple-darwin
    bug 
    opened by jayvdb 6
  • [BUG] **fn needs_root needs clarification**

    [BUG] **fn needs_root needs clarification**

    Describe the bug N/A N/A

    Expected behavior N/A

    Desktop (please complete the following information): N/A

    Additional context How does needs_root work? Does it try to install everything with sudo prefixed, or something else? What about a system without sudo, like a BSD derivitive? Would it use doas? And what about package managers like npm, pip, and brew, which can both use sudo and not use sudo?

    Machine information N//A

    bug wontfix 
    opened by theHedgehog0 6
  • [BUG] **emplace install**

    [BUG] **emplace install**

    emplace install 16:00:49 [ INFO] No configuration file found. The URL of the git repository you (want to) store the mirrors in: link values must be emitted before tables 16:00:52 [ERROR] Critical Emplace error while installing packages

    Caused by: values must be emitted before tables

    bug 
    opened by 0xdeafbeef 6
  • add zypper support

    add zypper support

    What is the name of the package manager you would like to see support for?

    zypper

    What operating systems or derivative does this package manager support?

    • [ ] Windows
    • [ ] Mac
    • [x] Linux
    • [ ] BSD
    • [ ] Redox
    • [ ] iOS
    • [ ] Android
    • [ ] Other, namely:

    If Linux, is it only for a specific distro?

    • [x] Yes, namely: opensuse
    • [ ] No

    What type of package manager is this?

    • [ ] Programming language specific (e.g. Cargo for Rust)
    • [x] General purpose (e.g. APT on Debian)
    • [ ] Other, namely:

    Are administrator priviliges required? (sudo, etc.)

    • [x] Yes
    • [ ] No

    I took a stab at adding zypper support, but it's not fully working. Zypper supports a shortened version in in place of install, which is successfully captured for most of the test cases. Unfortunately, it's also matching and being removed from packages with in in them.

    ---- package_manager::zypper::tests::test_catch stdout ----
    thread 'package_manager::zypper::tests::test_catch' panicked at 'assertion failed: `(left == right)`
      left: `"linux-perf-5.3"`,
     right: `"lux-perf-5.3"`: Package "lux-perf-5.3" should be matched, but it's not', src/package_manager/zypper.rs:64:9
    

    Any ideas on a fix?

    opened by adamcstephens 5
  • Update toolmantim/release-drafter action to v5.21.1

    Update toolmantim/release-drafter action to v5.21.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | toolmantim/release-drafter | action | patch | v5.21.0 -> v5.21.1 |


    Release Notes

    toolmantim/release-drafter

    v5.21.1

    Compare Source

    What's Changed

    Dependency Updates

    Full Changelog: https://github.com/release-drafter/release-drafter/compare/v5.21.0...v5.21.1


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • [FEATURE] Support for `cargo-binstall`

    [FEATURE] Support for `cargo-binstall`

    What is the name of the package manager you would like to see support for? cargo-binstall

    What operating systems or derivative does this package manager support?

    • [x] Windows
    • [x] Mac
    • [x] Linux
    • [ ] BSD
    • [ ] Redox
    • [ ] iOS
    • [ ] Android
    • [ ] Other, namely:

    If Linux, is it only for a specific distro?

    • [ ] Yes, namely:
    • [x] No

    What type of package manager is this?

    • [x] Programming language specific (e.g. Cargo for Rust)
    • [x] General purpose (e.g. APT on Debian)
    • [ ] Other, namely:

    Are administrator priviliges required? (sudo, etc.)

    • [ ] Yes
    • [x] No
    enhancement 
    opened by ololduck 5
  • Update Rust crate clap_complete to v4

    Update Rust crate clap_complete to v4

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap_complete | dependencies | major | 3.2.4 -> 4.0.6 |


    Release Notes

    clap-rs/clap

    v4.0.6

    Compare Source

    v4.0.5

    Compare Source

    Features
    • Added Shell::from_env

    v4.0.4

    Compare Source

    v4.0.3

    Compare Source

    v4.0.2

    Compare Source

    Fixes
    • (bash) Fix git diff git <TAB> completions
    • (bash) Fix git diff log <TAB> completions
    • (bash) Fix command alias

    v4.0.1

    Compare Source

    Fixes
    • (zsh) Fix multiple-items regression introduced in v4

    v4.0.0

    Compare Source

    v3.2.5

    Compare Source

    [3.2.5] - 2022-06-15

    Fixes
    • (derive) Fix regression with #[clap(default_value_os_t ...)] introduced in v3.2.3

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate clap to v4

    Update Rust crate clap to v4

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | major | 3.2.17 -> 4.0.29 |


    Release Notes

    clap-rs/clap

    v4.0.29

    Compare Source

    v4.0.28

    Compare Source

    Fixes
    • Fix wasm support which was broken in 4.0.27

    v4.0.27

    Compare Source

    Features
    • Have Arg::value_parser accept Vec<impl Into<PossibleValue>>
    • Implement Display and FromStr for ColorChoice
    Fixes
    • Remove soundness issue by switching from atty to is-terminal

    v4.0.26

    Compare Source

    Fixes
    • (error) Fix typos in ContextKind::as_str

    v4.0.25

    Compare Source

    Features
    • (error) Report available subcommands when required subcommand is missing

    v4.0.24

    Compare Source

    Fixes
    • Avoid panic when printing an argument that isn't built

    v4.0.23

    Compare Source

    Fixes
    • Don't panic on reporting invalid-long errors when followed by invalid UTF8
    • (help) Clarified argument to help subcommand

    v4.0.22

    Compare Source

    Fixes
    • (help) Don't overflow into next-line-help early due to stale (pre-v4) padding calculations

    v4.0.21

    Compare Source

    Features
    • (derive) long_about and long_help attributes, without a value, force using doc comment (before it wouldn't be set if there wasn't anything different than the short help)

    v4.0.20

    Compare Source

    Fixes
    • (derive) Allow defaulted value parser for '()' fields

    v4.0.19

    Compare Source

    Features
    • ColorChoice now implements ValueEnum

    v4.0.18

    Compare Source

    Fixes
    • (derive) Allow #[command(skip)] to also work with enum variants with a value

    v4.0.17

    Compare Source

    Fixes
    • Allow using Arg::last(true) with Arg::value_hint(ValueHint::CommandWithArguments)

    v4.0.16

    Compare Source

    Fixes
    • Arg::exclusive(true) should not be exclusive with the argument's own ArgGroup

    v4.0.15

    Compare Source

    Fixes
    • (error) Don't suggest -- when it doesn't help
    • (error) Be more consistent in quoting, punctuation, and indentation in errors

    v4.0.14

    Compare Source

    Fixes
    • Only put ArgGroup in ArgMatches when explicitly specified, fixing derives handling of option-flattened fields (#​4375)

    v4.0.13

    Compare Source

    Features
    • (derive) Allow () for fields to mean "don't read" (#​4371)

    v4.0.12

    Compare Source

    Features
    • Added TypedValueParser::try_map for when adapting an existing TypedValueParser can fail
    • (error) Create errors like clap with Error::new, Error::with_cmd, and Error::insert

    v4.0.11

    Compare Source

    Fixes
    • (help) Fix wrapping calculations with ANSI escape codes

    v4.0.10

    Compare Source

    Features

    v4.0.9

    Compare Source

    Fixes
    • (derive) Process doc comments for #[command(subcommand)] like in clap v3

    v4.0.8

    Compare Source

    Fixes
    • (derive) Remove a low-value assert preventing defaulting Help and Version actions

    v4.0.7

    Compare Source

    Features
    • (derive) Populate implicit ArgGroup (#​3165)
    Fixes
    • (derive) Support #[group(skip)] on Parser derive
    • (derive) Tell users about implicit arg groups when running into group name conflicts
    • (error) Don't report unrelated groups in conflict or requires errors

    v4.0.6

    Compare Source

    Features

    v4.0.5

    Compare Source

    v4.0.4

    Compare Source

    Fixes
    • (error) Specialize the self-conflict error to look like clap v3

    v4.0.3

    Compare Source

    Fixes
    • (error) Quote literals consistently
    • (error) Stylize escape (--) suggestions
    • (error) Format help flag as a literal

    v4.0.2

    Compare Source

    v4.0.1

    Compare Source

    Features
    • ColorChoice now implements ValueEnum

    v4.0.0

    Compare Source

    Highlights

    Arg::num_args(range)

    Clap has had several ways for controlling how many values will be captured without always being clear on how they interacted, including

    • Arg::multiple_values(true)
    • Arg::number_of_values(4)
    • Arg::min_values(2)
    • Arg::max_values(20)
    • Arg::takes_value(true)

    These have now all been collapsed into Arg::num_args which accepts both single values and ranges of values. num_args controls how many raw arguments on the command line will be captured as values per occurrence and independent of value delimiters.

    See Issue 2688 for more background.

    Polishing Help

    Clap strives to give a polished CLI experience out of the box with little ceremony. With some feedback that has accumulated over time, we took this release as an opportunity to re-evaluate our --help output to make sure it is meeting that goal.

    In doing this evaluation, we wanted to keep in mind:

    • Whether other CLIs had ideas that make sense to apply
    • Providing an experience that fits within the rest of applications and works across all shells

    Before:

    git
    A fictional versioning CLI
    
    USAGE:
        git <SUBCOMMAND>
    
    OPTIONS:
        -h, --help    Print help information
    
    SUBCOMMANDS:
        add      adds things
        clone    Clones repos
        help     Print this message or the help of the given subcommand(s)
        push     pushes things
        stash
    

    After:

    A fictional versioning CLI
    
    Usage: git <COMMAND>
    
    Commands:
      clone  Clones repos
      push   pushes things
      add    adds things
      stash
      help   Print this message or the help of the given subcommand(s)
    
    Options:
      -h, --help  Print help information
    
    • name/version header was removed because we couldn't justify the space it occupied when
      • Usage already includes the name
      • --version is available for showing the same thing (if the program has a version set)
    • Usage was dropped to one line to save space
    • Focus is put on the subcommands
    • Headings are now Title case
    • The more general term "command" is used rather than being explicit about being "subcommands"
    • The output is more dense with the expectation that it won't affect legibility but will allow more content
    • We've moved to a more neutral palette for highlighting elements (not highlighted above)

    In talking to users, we found some that liked clap's man-like experience. When deviating from this, we are making the assumption that those are more power users and that the majority of users wouldn't look as favorably on being consistent with man.

    See Issue 4132 for more background.

    More Dynamicism

    Clap's API has focused on &str for performance but this can make dealing with owned data difficult, like #[arg(default_value_t)] generating a String from the default value.

    Additionally, to avoid ArgMatches from borrowing (and for some features we decided to forgo), clap took the &str argument IDs and hashed them. This prevented us from providing a usable API for iterating over existing arguments.

    Now clap has switched to a string newtype that gives us the flexibility to decide whether to use &'static str, Cow<'static, str> for fast dynamic behavior, or Box<str> for dynamic behavior with small binary size.

    As an extension of that work, you can now call ArgMatches::ids to iterate over the arguments and groups that were found when parsing. The newtype Id was used to prevent some classes of bugs and to make it easier to understand when opaque Ids are used vs user-visible strings.

    Clearing Out Deprecations

    Instead of doing all development on clap 4.0.0, we implemented a lot of new features during clap 3's development, deprecating the old API while introducing the new API, including:

    • Replacing the implicit behavior for args when parsing them with ArgAction
    • Replacing various one-off forms of value validation with the ValueParser API
      • Allowing derives to automatically do the right thing for PathBuf (allowing invalid UTF-8)
    • Replacing AppSettings and ArgSettings enums with getters/setters
    • Clarifying terms and making them more consistent
    Migrating

    Steps:

    1. Upgrade to v3 if you haven't already
    2. Add CLI tests (including example below), -h and --help output at a minimum (recommendation: trycmd for snapshot testing)
    3. If using Builder API: Explicitly set the arg.action(ArgAction::...) on each argument (StoreValue for options and IncOccurrences for flags)
    4. Run cargo check --features clap/deprecated and resolve all deprecation warnings
    5. Upgrade to v4
    6. Update feature flags
    • If default-features = false, run cargo add clap -F help,usage,error-context
    • Run cargo add clap -F wrap_help unless you want to hard code line wraps
    1. Resolve compiler errors
    2. Resolve behavior changes (see "subtle changes" under BREAKING CHANGES)
    3. At your leisure: resolve new deprecation notices

    Example test (derive):

    
    #[derive(clap::Parser)]
    struct Cli {
        ...
    }
    
    #[test]
    fn verify_cli() {
        use clap::CommandFactory;
        Cli::command().debug_assert()
    }
    

    Example test (builder):

    fn cli() -> clap::Command {
        ...
    }
    
    #[test]
    fn verify_cli() {
        cli().debug_assert();
    }
    

    Note: the idiomatic / recommended way of specifying different types of args in the Builder API has changed:

    Before

    .arg(Arg::new("flag").long("flag"))  # --flag
    .arg(Arg::new("option").long("option").takes_value(true))  # --option <option>
    

    After:

    .arg(Arg::new("flag").long("flag").action(ArgAction::SetTrue))  # --flag
    .arg(Arg::new("option").long("option"))  # --option <option>
    

    In particular, num_args (the replacement for takes_value) will default appropriately from the ArgAction and generally only needs to be set explicitly for the other num_args use cases.

    Breaking Changes

    Subtle changes (i.e. compiler won't catch):

    • arg! now sets one of (#​3795):
      • ArgAction::SetTrue, requiring ArgMatches::get_flag instead of ArgMatches::is_present
      • ArgAction::Count, requiring ArgMatches::get_count instead of ArgMatches::occurrences_of
      • ArgAction::Set, requiring ArgMatches::get_one instead of ArgMatches::value_of
      • ArgAction::Append, requiring ArgMatches::get_many instead of ArgMatches::values_of
    • ArgAction::Set, ArgAction::SetTrue, and Arg::Action::SetFalse now conflict by default to be like ArgAction::StoreValue and ArgAction::IncOccurrences, requiring cmd.args_override_self(true) to override instead (#​4261)
    • By default, an Args default action is ArgAction::Set, rather than ArgAction::IncOccurrence to reduce confusing magic through consistency (#​2687, #​4032, see also #​3977)
    • mut_arg can no longer be used to customize help and version arguments, instead disable them (Command::disable_help_flag, Command::disable_version_flag) and provide your own (#​4056)
    • Removed lifetimes from Command, Arg, ArgGroup, and PossibleValue, assuming 'static. string feature flag will enable support for Strings (#​1041, #​2150, #​4223)
    • arg!(--flag <value>) is now optional, instead of required. Add .required(true) at the end to restore the original behavior (#​4206)
    • Added default feature flags, help, usage and error-context, requiring adding them back in if default-features = false (#​4236)
    • (parser) Always fill in "" argument for external subcommands to make it easier to distinguish them from built-in commands (#​3263)
    • (parser) Short flags now have higher precedence than hyphen values with Arg::allow_hyphen_values, to be consistent with Command::allow_hyphen_values (#​4187)
    • (parser) Arg::value_terminator must be its own argument on the CLI rather than being in a delimited list (#​4025)
    • (help) Line wrapping of help is now behind the existing wrap_help feature flag, either enable it or hard code your wraps (#​4258)
    • (help) Make DeriveDisplayOrder the default and removed the setting. To sort help, set next_display_order(None) (#​2808)
    • (help) Subcommand display order respects Command::next_display_order instead of DeriveDisplayOrder and using its own initial display order value (#​2808)
    • (help) Subcommands are now listed before arguments. To get the old behavior, see Command::help_template (#​4132)
    • (help) Help headings are now title cased, making any user-provided help headings inconsistent. To get the old behavior, see Command::help_template, Arg::help_heading, and Command::subcommand_help_heading (#​4132)
    • (help) "Command" is used as the section heading for subcommands and COMMAND for the value name. To get the old behavior, see Command::subcommand_help_heading and Arg::subcommand_value_name (#​4132, #​4155)
    • (help) Whitespace in help output is now trimmed to ensure consistency regardless of how well a template matches the users needs. (#​4132, #​4156)
    • (help) name/version/author are removed by default from help output. To get the old behavior, see Command::help_template. (#​4132, #​4160)
    • (help) Indentation for second-line usage changed. (#​4132, #​4188)
    • (env) Parse --help and --version like any ArgAction::SetTrue flag (#​3776)
    • (derive) Leave Arg::id as verbatim casing, requiring updating of string references to other args like in conflicts_with or requires (#​3282)
    • (derive) Doc comments for ValueEnum variants will now show up in --help (#​3312)
    • (derive) When deriving Args, and ArgGroup is created using the type's name, reserving it for future use (#​2621, #​4209)
    • (derive) next_help_heading can now leak out of a #[clap(flatten)], like all other command settings (#​4222)

    Easier to catch changes:

    • Looking up a group in ArgMatches now returns the arg Ids, rather than the values to reduce overhead and offer more flexibility. (#​4072)
    • Changed Arg::number_of_values (average-across-occurrences) to Arg::num_args (per-occurrence) (raw CLI args, not parsed values) (#​2688, #​4023)
      • num_args(0) no longer implies takes_value(true).multiple_values(true) (#​4023)
      • num_args(1) no longer implies multiple_values(true) (#​4023)
      • Does not check default or env values, only what the user explicitly passes in (#​4025)
      • No longer terminates on delimited values (#​4025)
    • Replace Arg::min_values (across all occurrences) with Arg::num_args(N..) (per occurrence) to reduce confusion over different value count APIs (#​4023)
    • Replace Arg::max_values (across all occurrences) with Arg::num_args(1..=M) (per occurrence) to reduce confusion over different value count APIs (#​4023)
    • Replace Arg::multiple_values(true) with Arg::num_args(1..) and Arg::multiple_values(false) with Arg::num_args(0) to reduce confusion over different value count APIs (#​4023)
    • Replace Arg::takes_value(true) with Arg::num_args(1) and Arg::takes_value(false) with Arg::num_args(0) to reduce confusion over different value count APIs
    • Remove Arg::require_value_delimiter, either users could use Arg::value_delimiter or implement a custom parser with TypedValueParser as it was mostly to make multiple_values(true) act like multiple_values(false) and isn't needed anymore (#​4026)
    • Arg::new("help") and Arg::new("version") no longer implicitly disable the built-in flags and be copied to all subcommands, instead disable the built-in flags (Command::disable_help_flag, Command::disable_version_flag) and mark the custom flags as global(true). (#​4056)
    • Arg::short('h') no longer implicitly disables the short flag for help, instead disable the built-in flags (Command::disable_help_flag, Command::disable_version_flag) provide your own Arg::new("help").long("help").action(ArgAction::Help).global(true). (#​4056)
    • ArgAction::SetTrue and ArgAction::SetFalse now prioritize Arg::default_missing_value over their standard behavior (#​4000)
    • Changed Arg::requires_ifs and Arg::default_value*_ifs* to taking an ArgPredicate, removing ambiguity with None when accepting owned and borrowed types (#​4084)
    • Removed PartialEq and Eq from Command so we could change external subcommands to use a ValueParser (#​3990)
    • Various Arg, Command, and ArgGroup calls were switched from accepting &[] to [] via IntoIterator to be more flexible (#​4072)
    • Arg::short_aliases and other builder functions that took &[] need the & dropped (#​4081)
    • ErrorKind and Result moved into the error module
    • ErrorKind::EmptyValue replaced with ErrorKind::InvalidValue to remove an unnecessary special case (#​3676, #​3968)
    • ErrorKind::UnrecognizedSubcommand replaced with ErrorKind::InvalidSubcommand to remove an unnecessary special case (#​3676)
    • Changed the default type of allow_external_subcommands from String to OsString as that is less likely to cause bugs in user applications (#​3990)
    • (help) Command::render_usage now returns a StyledStr (#​4248)
    • (derive) Changed the default for arguments from parse to value_parser, removing parse support (#​3827, #​3981)
      • #[clap(value_parser)] and #[clap(action)] are now redundant
    • (derive) subcommand_required(true).arg_required_else_help(true) is set instead of SubcommandRequiredElseHelp to give more meaningful errors when subcommands are missing and to reduce redundancy (#​3280)
    • (derive) Remove arg_enum attribute in favor of value_enum to match the new name (we didn't have support in v3 to mark it deprecated) (#​4127)
    • (parser) Assert when the CLI looksup an unknown args when external subcommand support is enabled to help catch bugs (#​3703)
    • (assert) Sometimes Arg::default_missing_value didn't require num_args(0..=N), now it does (#​4023)
    • (assert) Leading dashes in Arg::long are no longer allowed (#​3691)
    • (assert) Disallow more value_names than num_args (#​2695)
    • (assert) Always enforce that version is specified when the ArgAction::Version is used
    • (assert) Add missing #[track_caller]s to make it easier to debug asserts
    • (assert) Ensure overrides_with IDs are valid
    • (assert) Ensure no self-overrides_with now that Actions replace it
    • (assert) Ensure subcommand names are not duplicated
    • (assert) Assert on mut_arg receiving an invalid arg ID or mut_subcommand receiving an invalid command name
    Compatibility

    MSRV is now 1.60.0

    Deprecated

    • Arg::use_value_delimiter in favor of Arg::value_delimiter to avoid having multiple ways of doing the same thing
    • Arg::requires_all in favor of Arg::requires_ifs now that it takes an ArgPredicate to avoid having multiple ways of doing the same thing
    • Arg::number_of_values in favor of Arg::num_args to clarify semantic differences
    • default_value_os, default_values_os, default_value_if_os, and default_value_ifs_os as the non _os variants now accept either a str or an OsStr (#​4141)
    • Arg::env_os in favor of Arg::env
    • Command::dont_collapse_args_in_usage is now the default (#​4151)
    • Command::trailing_var_arg in favor of Arg::trailing_var_arg to make it clearer which arg it is meant to apply to (#​4187)
    • Command::allow_hyphen_values in favor of Arg::allow_hyphen_values to make it clearer which arg it is meant to apply to (#​4187)
    • Command::allow_negative_numbers in favor of Arg::allow_negative_numbers to make it clearer which arg it is meant to apply to (#​4187)
    • (help) Deprecated Command::write_help and Command::write_long_help in favor of Command::render_help and Command::render_long_help (#​4248)
    • (derive) structopt and clap attributes in favor of the more specific command, arg, and value to open the door for more features and clarify relationship to the builder (#​1807, #​4180)
    • (derive) #[clap(value_parser)] and #[clap(action)] defaulted attributes (its the default) (#​3976)

    Behavior Changes

    • (help) With wrap_help feature, if the terminal size cannot be determined, LINES and COLUMNS variables are used (#​4186)
    Features
    • Arg::num_args now accepts ranges, allowing setting both the minimum and maximum number of values per occurrence (#​2688, #​4023)
    • Allow non-bool value_parsers for ArgAction::SetTrue / ArgAction::SetFalse (#​4092)
    • Add From<&OsStr>, From<OsString>, From<&str>, and From<String> to value_parser! (#​4257)
    • Allow resetting most builder methods
    • Can now pass runtime generated data to Command, Arg, ArgGroup, PossibleValue, etc without managing lifetimes with the string feature flag (#​2150, #​4223)
    • New default error-context, help and usage feature flags that can be turned off for smaller binaries (#​4236)
    • Added StyledStr::ansi() to Display with ANSI escape codes (#​4248)
    • (error) Error::apply for changing the formatter for dropping binary size (#​4111)
    • (error) Error::renderfor formatting the error into a StyledStr
    • (help) Show PossibleValue::help in long help (--help) (#​3312)
    • (help) New {tab} variable for Command::help_template (#​4161)
    • (help) Command::render_help and Command::render_long_help for formatting the error into a StyledStr (#​3873, #​4248)
    • (help) Command::render_usage now returns a StyledStr (#​4248)
    Fixes
    • Verify required is not used with conditional required settings (#​3660)
    • Replaced cmd.allow_invalid_for_utf8_external_subcommands with cmd.external_subcommand_value_parser (#​3733)
    • Arg::default_missing_value now applies per occurrence rather than if a value is missing across all occurrences (#​3998)
    • arg!(--long [value]) to accept 0..=1 per occurrence rather than across all occurrences, making it safe to use with ArgAction::Append (#​4001)
    • Allow OsStrs for Arg::{required_if_eq,required_if_eq_any,required_if_eq_all} (#​4084)
    • (help) With wrap_help feature, if the terminal size cannot be determined, LINES and COLUMNS variables are used (#​4186)
    • (help) Use Command::display_name in the help title rather than Command::bin_name
    • (help) Show when a flag is ArgAction::Count by adding an ... (#​4003)
    • (help) Use a more neutral palette for coloring (#​4132, #​4117)
    • (help) Don't rely on ALL CAPS for help headers (#​4132, #​4123)
    • (help) List subcommands first, focusing the emphasis on them (#​4132, #​4125)
    • (help) Do not include global args in cmd help help (#​4131)
    • (help) Use [positional] in list when relevant (#​4144)
    • (help) Show all [positional] in usage (#​4151)
    • (help) Polish up subcommands by referring to them as commands (#​4132, #​4155)
    • (help) Trim extra whitespace to avoid artifacts from different uses of templates (#​4132, #​4156)
    • (help) Hint to the user the difference between -h / --help when applicable (#​4132, #​4159)
    • (help) Shorten help by eliding name/version/author (#​4132, #​4160)
    • (help) When short help is long enough to activate next_line_help, don't add blank lines (#​4132, #​4190)
    • (help) Make help output more dense (reducing horizontal whitespace) (#​4132, #​4192)
    • (help) Separate subcommand flags with "," like option flags (#​4232, #​4235)
    • (help) Quote the suggested help flag (#​4220)
    • (version) Use Command::display_name rather than Command::bin_name (#​3966)
    • (parser) Always fill in "" argument for external subcommands (#​3263)
    • (parser) Short flags now have higher precedence than hyphen values with Arg::allow_hyphen_values, like Command::allow_hyphen_values (#​4187)
    • (parser) Prefer InvalidSubcommand over UnknownArgument in more cases (#​4219)
    • (derive) Detect escaped external subcommands that look like built-in subcommands (#​3703)
    • (derive) Leave Arg::id as verbatim casing (#​3282)
    • (derive) Default to #[clap(value_parser, action)] instead of #[clap(parse)] (#​3827)

    v3.2.23

    Compare Source

    [3.2.23] - 2022-10-24

    Fixes
    • Upgrade to textwrap 0.16

    v3.2.22

    Compare Source

    [3.2.22] - 2022-09-16

    Fixes
    • Unify dependencies on terminal_size to the 0.2 release

    v3.2.21

    Compare Source

    [3.2.21] - 2022-09-12

    Features
    • TypedValueParser::map to allow reusing existing value parsers for other purposes

    v3.2.20

    Compare Source

    [3.2.20] - 2022-09-02

    Features
    • ArgMatches::get_count help for ArgAction::Count
    • ArgMatches::get_flag help for ArgAction::SetTrue / ArgAction::SetFalse

    v3.2.19

    Compare Source

    [3.2.19] - 2022-08-30

    Fixes
    • (help) Ensure required arguments for parent commands aren't shown in their subcommands when using args_conflicts_with_subcommand

    v3.2.18

    Compare Source

    Fixes
    • (help) Command::print_help now respects Command::colored_help
    • (derive) Improved error messages

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate console to 0.15.2

    Update Rust crate console to 0.15.2

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | console | dependencies | patch | 0.15.1 -> 0.15.2 |


    Release Notes

    console-rs/console

    v0.15.2

    Compare Source

    Enhancements
    • Dropped once_cell dependency to support MSRV again.

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate itertools to 0.10.5

    Update Rust crate itertools to 0.10.5

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | itertools | dependencies | patch | 0.10.3 -> 0.10.5 |


    Release Notes

    rust-itertools/itertools

    v0.10.5

    • Maintenance

    v0.10.4

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Releases(v1.4.2)
Owner
Thomas Versteeg
Thomas Versteeg
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Envwoman is an application, to sync your .env-files across multiple machines

Envwoman is an application, to sync your .env-files across multiple machines. The main goal is to make Envwoman secure and trustworthy, so everything is open-source and the data will never in plain-text on the server. Encryption happens client-sided via aes-gcm.

Mawoka 3 Sep 28, 2022
Slideo: This tool uses OpenCV to automatically synchronize slides with videos that show these slides.

This tool matches video frames against PDF pages by using computer vision. It also ships a web app in which you can click on a PDF page to play the video from the first frame showing the page. Its primary use-case is to quickly play a recorded lecture from a given slide.

Henning Dieterichs 78 Oct 7, 2022
Synchronize games from other platforms into your Steam library

BoilR Description This little tool will synchronize games from other platforms into your Steam library, using the Steam Shortcuts feature. The goal is

Philip Kristoffersen 823 Jan 9, 2023
Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another.

Mycelite What is Mycelite? Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another. Currently, it

Mycelial 16 Jan 2, 2023
An oauth2 client implementation providing the Device, Installed and Service Account flows.

yup-oauth2 is a utility library which implements several OAuth 2.0 flows. It's mainly used by google-apis-rs, to authenticate against Google services.

Lewin Bormann 174 Dec 30, 2022
A CLI tool that allow you to create a temporary new rust project using cargo with already installed dependencies

cargo-temp A CLI tool that allow you to create a new rust project in a temporary directory with already installed dependencies. Install Requires Rust

Yohan Boogaert 61 Oct 31, 2022
A CLI utility installed as "ansi" to quickly get ANSI escape sequences. Supports the most basic ones, like colors and styles as bold or italic.

'ansi' - a CLI utility to quickly get ANSI escape codes This Rust project called ansi-escape-sequences-cli provides an executable called ansi which ca

Philipp Schuster 5 Jul 28, 2022
A cargo subcommand for checking and applying updates to installed executables

cargo-update A cargo subcommand for checking and applying updates to installed executables Documentation Manpage Installation Firstly, ensure you have

наб 827 Jan 4, 2023
Use Git installed in Bash on Windows/Windows Subsystem for Linux (WSL) from Windows and Visual Studio Code (VSCode)

WSLGit This project provides a small executable that forwards all arguments to git running inside Bash on Windows/Windows Subsystem for Linux (WSL). T

A. R. S. 1.1k Jan 3, 2023
Synchronized state machines for Rust over WebSockets.

Aper is a framework for real-time sharing of application state over WebSockets.

null 191 Dec 20, 2022
Cassette A simple, single-future, non-blocking executor intended for building state machines.

Cassette A simple, single-future, non-blocking executor intended for building state machines. Designed to be no-std and embedded friendly. This execut

James Munns 50 Jan 2, 2023
Advanced Fuzzing Library - Slot your Fuzzer together in Rust! Scales across cores and machines. For Windows, Android, MacOS, Linux, no_std, ...

LibAFL, the fuzzer library. Advanced Fuzzing Library - Slot your own fuzzers together and extend their features using Rust. LibAFL is written and main

Advanced Fuzzing League ++ 1.2k Dec 29, 2022
Run your Rust CLI programs as state machines with persistence and recovery abilities

step-machine Run your CLI programs as state machines with persistence and recovery abilities. When such a program breaks you'll have opportunity to ch

Imbolc 31 Nov 23, 2022
Frame is a markdown language for creating state machines (automata) in 7 programming languages as well as generating UML documentation.

Frame Language Transpiler v0.5.1 Hi! So very glad you are interested in Frame. Frame system design markdown language for software architects and engin

Mark Truluck 35 Dec 31, 2022
LIBFFM - field-aware factorization machines - in Rust

LIBFFM Rust LIBFFM - field-aware factorization machines - in Rust Getting Started LIBFFM Rust is available as a Rust library and a command line tool.

Andrew Kane 1 Jan 8, 2022
Expose local age identities to remote machines via SSH

age-plugin-remote TBD Design Notes Proxy identities act as bearer tokens. A proxy identity is only "active" if the authority provides it when starting

null 6 Aug 19, 2022
Advanced Fuzzing Library - Slot your Fuzzer together in Rust! Scales across cores and machines. For Windows, Android, MacOS, Linux, no_std, ...

LibAFL, the fuzzer library. Advanced Fuzzing Library - Slot your own fuzzers together and extend their features using Rust. LibAFL is written and main

Advanced Fuzzing League ++ 1.2k Jan 6, 2023
Symbolically Executable Stack Machines in Rust

Symbolically Executable Stack Machines in Rust Symbolic Stack Machines is a library for implementing symbolically executable stack-based virtual machi

TannrA 64 Dec 28, 2022
A metrics collection application for Linux machines. Created for MSCS 710 Project at Marist College.

Linux-Metrics-Collector A metrics collection application for Linux machines. Created for MSCS 710 Project at Marist College. Development Environment S

Christopher Ravosa 2 May 2, 2022