Fast Discord RPC Client written in Rust

Overview

Discord RPC Client

Examples

Big image, small image, details and one button

discord rpc 1

discordrpc -c 942151169185316874 -d 'untypeable nickname' --button-1-text 'Discord RPC written in Rust' --button-1-url 'https://github.com/MedzikUser/discord-rpc' -N medzik -I medzik -n archlinux -i archlinux`

Big image, details, state and two buttons

discord rpc 2

discordrpc -c 942151169185316874 -d 'untypeable nickname' -s 'MedzikUser' --button-1-text 'Discord RPC written in Rust' --button-1-url 'https://github.com/MedzikUser/discord-rpc' --button-2-text 'GitHub' --button-2-url 'https://github.com/MedzikUser' -N medzik -I medzik

How to install?

Linux

Download discordrpc-linux from the releases page and run

chmod +x discordrpc-linux
./discordrpc-linux

Arch Linux

Using yay (AUR)

yay -S discordrpc

Alternatively you can add this repo and run

sudo pacman -S discordrpc

OSX

Download discordrpc-darwin from the releases page and run

chmod +x discordrpc-darwin
./discordrpc-darwin

Windows

Download discordrpc-windows from the releases page and run

chmod +x discordrpc-windows
./discordrpc-windows

Compile with Cargo

Make sure you have the latest version of Rust. Then you can run

cargo install imgurs

How do I get a client id?

  1. Go to Discord Developer Portal
  2. Make New Application, name them freely (the name will be displayed in RPC)

new app

  1. Go to General Information

general

  1. Copy ID

copy id

  1. Then go to the Rich Presence tab (optional)

rich presence

  1. Add images to be able to display them in RPC (optional)

add image

Comments
  • Update Rust crate clap to 3.2.23

    Update Rust crate clap to 3.2.23

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 3.2.22 -> 3.2.23 |


    Release Notes

    clap-rs/clap

    v3.2.23

    Compare Source

    [3.2.23] - 2022-10-24

    Fixes
    • Upgrade to textwrap 0.16

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

    opened by renovate[bot] 0
  • Update Rust crate discord-rich-presence to 0.2.3

    Update Rust crate discord-rich-presence to 0.2.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | discord-rich-presence | dependencies | patch | 0.2.2 -> 0.2.3 |


    Release Notes

    sardonicism-04/discord-rich-presence

    v0.2.3

    What's Changed

    New Contributors

    Full Changelog: https://github.com/sardonicism-04/discord-rich-presence/compare/0.2.1...0.2.3


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

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

    Update Rust crate clap to 3.2.22

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 3.2.21 -> 3.2.22 |


    Release Notes

    clap-rs/clap

    v3.2.22

    Compare Source

    [3.2.22] - 2022-09-16

    Fixes
    • Unify dependencies on terminal_size to the 0.2 release

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

    opened by renovate[bot] 0
  • Update Rust crate clap_complete to 3.2.5

    Update Rust crate clap_complete to 3.2.5

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap_complete | dependencies | patch | 3.2.4 -> 3.2.5 |


    Release Notes

    clap-rs/clap

    v3.2.5

    Compare Source

    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: Enabled.

    β™» 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, click this checkbox.

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

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

    Update Rust crate clap to 3.2.21

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 3.2.20 -> 3.2.21 |


    Release Notes

    clap-rs/clap

    v3.2.21

    Compare Source

    [3.2.21] - 2022-09-12

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

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

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

    Update Rust crate clap to 3.2.20

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 3.2.19 -> 3.2.20 |


    Release Notes

    clap-rs/clap

    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

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

    opened by renovate[bot] 0
  • Update Rust crate clap_mangen to 0.1.11

    Update Rust crate clap_mangen to 0.1.11

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap_mangen | dependencies | patch | 0.1.10 -> 0.1.11 |


    Release Notes

    clap-rs/clap

    v0.1.11

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

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

    Update Rust crate clap to 3.2.19

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 3.2.18 -> 3.2.19 |


    Release Notes

    clap-rs/clap

    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

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

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

    Update Rust crate clap to 3.2.18

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 3.2.17 -> 3.2.18 |


    Release Notes

    clap-rs/clap

    v3.2.18

    Compare Source

    [3.2.18] - 2022-08-29

    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: Enabled.

    β™» 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, click this checkbox.

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

    opened by renovate[bot] 0
  • Update Rust crate clap_complete to 3.2.4

    Update Rust crate clap_complete to 3.2.4

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap_complete | dependencies | patch | 3.2.3 -> 3.2.4 |


    Release Notes

    clap-rs/clap

    v3.2.4

    Compare Source

    Fixes
    • (derive) Provide more clearer deprecation messages for #[clap(parse)] attribute (#​3832)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

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

    Update Rust crate clap to 3.2.17

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 3.2.16 -> 3.2.17 |


    Release Notes

    clap-rs/clap

    v3.2.17

    Compare Source

    [3.2.17] - 2022-08-12

    Fixes
    • (derive) Expose #[clap(id = ...)] attribute to match Arg's latest API

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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, click this checkbox.

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

    opened by renovate[bot] 0
  • Socket Error: This socket has been ended by the other party

    Socket Error: This socket has been ended by the other party

    Hi, Well done for this contribution, so I wanted to give a try with this little cli utility. I created the application, copy the client id, then added only the detail field

    The connection seems to work, I can see the RPC/IPC call received in the discord devtool, and discordrpc shows "Connected!" But nothing is displayed on my profile, and a second later, discord throws the following error:

    [RPCServer:IPC] Socket Error: This socket has been ended by the other party
    

    Is your utility compatible with the latest version of discord?

    Best regards, Emie

    opened by SkyEmie 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.5 -> 4.0.7 |


    Release Notes

    clap-rs/clap

    v4.0.7

    Compare Source

    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


    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.23 -> 4.0.32 |


    Release Notes

    clap-rs/clap

    v4.0.32

    Compare Source

    Fixes
    • (parser) When overriding required(true), consider args that conflict with its group

    v4.0.31

    Compare Source

    Performance
    • Speed up parsing when a lot of different flags are present (100 unique flags)

    v4.0.30

    Compare Source

    Fixes
    • (error) Improve error for args_conflicts_with_subcommand

    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
    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
    • (parser) When overriding required(true), consider args that conflict with its group

    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)

    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_mangen to 0.2.6

    Update Rust crate clap_mangen to 0.2.6

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap_mangen | dependencies | minor | 0.1.11 -> 0.2.6 |


    Release Notes

    clap-rs/clap

    v0.2.6

    Compare Source

    v0.2.5

    Compare Source

    v0.2.4

    Compare Source

    Fixes
    • Don't show defaults for flags

    v0.2.3

    Compare Source

    v0.2.2

    Compare Source

    Fixes
    • Reference to subcommand man pages now lists the correct name

    v0.2.1

    Compare Source

    Fixes
    • Respect hide attributes in more cases

    v0.2.0

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    β™» 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 mindsers/changelog-reader-action action to v2

    Update mindsers/changelog-reader-action action to v2

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | mindsers/changelog-reader-action | action | major | v1 -> v2 |


    Release Notes

    mindsers/changelog-reader-action

    v2

    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
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    cargo
    Cargo.toml
    • better-panic 0.3.0
    • clap 3.2.23
    • clap_complete 3.2.5
    • clap_mangen 0.1.11
    • colored 2.0.0
    • discord-rich-presence 0.2.3
    github-actions
    .github/workflows/build-release-binaries.yml
    • actions/checkout v3
    • actions-rs/toolchain v1
    • actions/cache v3
    • actions-rs/cargo v1
    • svenstaro/upx-action v2
    • actions/upload-artifact v3
    • mindsers/changelog-reader-action v1
    • svenstaro/upload-release-action v2
    • actions/checkout v3
    • actions-rs/toolchain v1
    • actions-rs/cargo v1
    .github/workflows/build.yml
    • actions/checkout v3
    • actions-rs/toolchain v1
    • actions/cache v3
    • actions-rs/cargo v1
    • actions-rs/cargo v1
    • actions-rs/cargo v1

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Releases(v0.2.2)
Owner
Oskar
Oskar
Futures implementation for JSON-RPC

futures-jsonrpc Futures + JSON-RPC A lightweight remote procedure call protocol. It is designed to be simple! And, with futures, even more flexible! T

Victor Lopes 12 May 19, 2022
JSON-RPC endpoint proxy that dumps requests/responses for debugging

json_rpc_snoop How to build Ensure you have cargo installed and in your PATH (the easiest way is to visit https://rustup.rs/) make This will create t

null 10 Dec 14, 2022
A simple configuration-based module for inter-network RPC in Holochain hApps.

DNA Auth Resolver A simple configuration-based module for inter-network RPC in Holochain hApps. About Usage In the origin zome In the destination DNA

Shadman Baig 0 Feb 4, 2022
Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password.

nostr-irc Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password. Experimental code, use

null 11 Dec 26, 2022
An implementation of the classic arcade game Whac-A-Hole inside Discord, made in 12 hours, with no experience in Rust.

Whac-A-Hole A blazingly fast implementation of the classic arcade game What-A-Hole inside Discord, made in 12 hours, with no experience in Rust ( ?? ?

Face 6 Mar 20, 2023
Drop-in proxy for Discord gateway connections and sessions allowing for zero downtime deploys

gateway-proxy This is a very hacky project, so it might stop working if Discord changes their API core. This is unlikely, but keep that in mind while

Jens Reidel 39 Nov 26, 2022
A Markov chain based Discord chat bot.

A Markov chain based Discord chat bot. Building It is recommended to use cargo.

Dominik MiedziΕ„ski 1 Dec 26, 2021
A ddns client written in Rust.

ddns-rs ready for use with one cloudflare A/AAAA record ?? A ddns client written in Rust. Features get public ip cloudflare (A or AAAA record) toml co

Ric Li 1 Oct 25, 2022
An online version of the popular game four in a row, written in Rust on the server side and Flutter + Dart on the client.

Four in a Row - Server An online version of the popular game four in a row, written in Rust on the server side and Flutter + Dart on the client. Downl

Filippo OrrΓΉ 8 Sep 16, 2022
Socket.io client written in Rust

Rust-socketio-client An implementation of a socket.io client written in the rust programming language. This implementation currently supports revision

Hand of Midas 4 May 9, 2023
RDE1 (Rusty Data Exfiltrator) is client and server tool allowing auditor to extract files from DNS and HTTPS protocols written in Rust. πŸ¦€

Information: RDE1 is an old personal project (end 2022) that I didn't continue development on. It's part of a list of projects that helped me to learn

Quentin Texier (g0h4n) 32 Oct 6, 2023
A fast and stable reverse proxy for NAT traversal, written in Rust

rathole A fast and stable reverse proxy for NAT traversal, written in Rust rathole, like frp, can help to expose the service on the device behind the

Yujia Qiao 4.6k Dec 30, 2022
RCProxy - a lightweight, fast but powerful Redis Cluster Proxy written in Rust

RCProxy - a lightweight, fast but powerful Redis Cluster Proxy written in Rust

Cris Liao 16 Dec 4, 2022
A Lightning-Fast DNS Resolver written in Rust πŸ¦€

dnsresolver A Lightning-Fast DNS Resolver Table of Contents Installation Usage Basic Usage Resolving Hosts with Ports Virtual Host Enumeration Using U

zoidsec 47 Nov 8, 2023
A simple ping utility written in Rust, that is focused on being size efficient and fast.

MeowPing MeowPing is a command-line utility for testing network connectivity using ICMP echo requests or TCP connections. It provides similar function

enty 3 Feb 28, 2024
FTP client for Rust

rust-ftp FTP client for Rust Documentation rust-ftp Installation Usage License Contribution Development environment Installation FTPS support is achie

Matt McCoy 155 Nov 12, 2022
NNTP client for Rust

rust-nntp NNTP Client for Rust Usage extern crate nntp; use nntp::{Article, NNTPStream}; fn main() { let mut nntp_stream = match NNTPStream::connec

Matt McCoy 13 Jan 22, 2022
POP3 client for Rust

rust-pop3 POP3 Client for Rust This client has SSL support. SSL is configured using an SSLContext that is passed into the connect method of a POP3Stre

Matt McCoy 26 Dec 19, 2022
A STOMP client in Rust. Compatible with RabbitMQ, ActiveMQ.

stomp-rs stomp-rs provides a full STOMP 1.2 client implementation for the Rust programming language. This allows programs written in Rust to interact

Zack Slayton 84 Dec 4, 2022