A command-line tool for patching shell scripts inspired by resholve

Overview

patsh

version deps license ci

A command-line tool for patching shell scripts inspired by resholve

nix run github:nix-community/patsh -- -f script.sh

Usage

Usage: patsh [OPTIONS]  [OUTPUT]

Arguments:
     the file to be patched
  [OUTPUT]  output path of the patched file, defaults to the input path, however, --force is required to patch in place

Options:
  -b, --bash     bash command used to list the built-in commands [default: bash]
  -f, --force             remove existing output file if needed
  -p, --path        use something other than the PATH variable for path resolution
  -s, --store-dir   path to the nix store, e.g. `builtins.storeDir` [default: /nix/store]
  -h, --help              Print help information
  -V, --version           Print version information

TODO

  • ansi-c quoting
  • resolving variables
  • diagnostics for unresolved commands

Changelog

See CHANGELOG.md

You might also like...
A command line interface meant to bridge the gap between Rust and shell scripting

clawbang A command line interface meant to bridge the gap between Rust and shell scripting. Intended for use with HEREDOCs and shebangs: $ clawbang

A system clipboard command line tools which inspired by pbcopy & pbpaste but better to use.

rclip A command line tool which supports copy a file contents to the system clipboard or copy the contents of the system clipboard to a file. Install

Shellharden is a syntax highlighter and a tool to semi-automate the rewriting of scripts to ShellCheck conformance, mainly focused on quoting
Shellharden is a syntax highlighter and a tool to semi-automate the rewriting of scripts to ShellCheck conformance, mainly focused on quoting

Shellharden is a syntax highlighter and a tool to semi-automate the rewriting of scripts to ShellCheck conformance, mainly focused on quoting

A CLI tool for CIs and build scripts, making file system based caching easy and correct (locking, eviction, etc.)

FS Dir Cache A CLI tool for CIs and build scripts, making file system based caching easy and correct (locking, eviction, etc.) When working on build s

A command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects.

CCake CCake is a command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects. Goals To be easily und

🍬 shell-candy is a library that wraps Rust's `std::process::Command`

🍬 shell-candy is a library that wraps Rust's `std::process::Command`, providing a functional mechanism for handling stdout/stderr streams of spawned tasks..

🚀 Supercharge your development with easy to setup package scripts

Mist 🚀 Supercharge your development with easy to setup package scripts. Works with every codebase regardless of the language or framework used! Note:

solve scripts for all 3 of @0xhana's paradigm ctf challs!

hana solana ctf ok like all the best software engineers i got the technicals done on time and under budget but left documentation for future me. its n

Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Comments
  • Bump clap from 4.0.30 to 4.0.32

    Bump clap from 4.0.30 to 4.0.32

    Bumps clap from 4.0.30 to 4.0.32.

    Release notes

    Sourced from clap's releases.

    v4.0.32

    [4.0.32] - 2022-12-22

    Fixes

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

    v4.0.31

    [4.0.31] - 2022-12-22

    Performance

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

    Sourced from clap's changelog.

    [4.0.32] - 2022-12-22

    Fixes

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

    [4.0.31] - 2022-12-22

    Performance

    • Speed up parsing when a lot of different flags are present (100 unique flags)
    Commits
    • ec4ccf0 chore: Release
    • 13fdb83 docs: Update changelog
    • b877345 Merge pull request #4573 from epage/conflict
    • 85ecb3e fix(parser): Override required when parent group has conflict
    • d145b8b test(parser): Demonstrate required-overload bug
    • 0eccd55 chore: Release
    • 1e37c25 docs: Update changelog
    • dcd5fec Merge pull request #4572 from epage/group
    • dde22e7 style: Update for latest clippy
    • dd8435d perf(parser): Reduce duplicate lookups
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies rust 
    opened by dependabot[bot] 0
  • Bump clap from 4.0.29 to 4.0.30

    Bump clap from 4.0.29 to 4.0.30

    Bumps clap from 4.0.29 to 4.0.30.

    Release notes

    Sourced from clap's releases.

    v4.0.30

    [4.0.30] - 2022-12-21

    Fixes

    • (error) Improve error for args_conflicts_with_subcommand
    Changelog

    Sourced from clap's changelog.

    [4.0.30] - 2022-12-21

    Fixes

    • (error) Improve error for args_conflicts_with_subcommand
    Commits
    • d2d0222 chore: Release
    • 56a0bb6 docs: Update changelog
    • b941a3e Merge pull request #4567 from epage/error
    • 453ac0b fix(parser): Be less confusing with args/subcommand conflicts
    • 2a374db test(parser): Show bad behavior
    • f632424 test(parser): Consolidate args_conflicts_with tests
    • a72f962 docs(builder): Escape non-tags
    • ac48e2d docs: Make less brittle for rust versions
    • a3381a2 docs(readme): Fix build status badge (#4559)
    • aa54204 Merge pull request #4555 from epage/reset
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies rust 
    opened by dependabot[bot] 0
  • Bump anyhow from 1.0.66 to 1.0.68

    Bump anyhow from 1.0.66 to 1.0.68

    Bumps anyhow from 1.0.66 to 1.0.68.

    Release notes

    Sourced from anyhow's releases.

    1.0.67

    • Improve the backtrace captured when context() is used on an Option (#280)
    Commits
    • 867763b Release 1.0.68
    • c0a87d0 Opt out -Zrustdoc-scrape-examples on docs.rs
    • 1cc707b Release 1.0.67
    • 613b261 Update build status badge
    • 0f922d7 Disable backtrace CI on Rust 1.50
    • acecd9b Update ui test suite to nightly-2022-12-15
    • 0bac51f Time out workflows after 45 minutes
    • 60e8800 Fix renamed let_underscore_drop lint
    • 8d1c734 Update ui test suite to nightly-2022-11-16
    • 451651b Update ui test suite to nightly-2022-11-11
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies rust 
    opened by dependabot[bot] 0
  • Bump clap from 4.0.27 to 4.0.29

    Bump clap from 4.0.27 to 4.0.29

    Bumps clap from 4.0.27 to 4.0.29.

    Release notes

    Sourced from clap's releases.

    v4.0.29

    [4.0.29] - 2022-11-29

    v4.0.28

    [4.0.28] - 2022-11-29

    Fixes

    • Fix wasm support which was broken in 4.0.27
    Changelog

    Sourced from clap's changelog.

    [4.0.29] - 2022-11-29

    [4.0.28] - 2022-11-29

    Fixes

    • Fix wasm support which was broken in 4.0.27
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies rust 
    opened by dependabot[bot] 0
Releases(v0.2.0)
Owner
Nix community projects
A project incubator that works in parallel of the @NixOS org
Nix community projects
Shellcheck - a static analysis tool for shell scripts

ShellCheck - A shell script static analysis tool ShellCheck is a GPLv3 tool that gives warnings and suggestions for bash/sh shell scripts: The goals o

Vidar Holen 31.1k Jan 9, 2023
Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

null 3 Nov 2, 2023
Self-contained template system with Handlebars and inline shell scripts

Handlematters Self-contained template system with Handlebars and inline shell scripts Introduction Handlematters is a template system that combines Ha

Keita Urashima 3 Sep 9, 2022
Quickly save and retrieve values for shell scripts.

Quickly save and retrieve values for shell scripts.

Alex Andrade 2 Dec 15, 2022
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
Honkers launcher for Linux with automatic patching and telemetry disabling

Honkers launcher for Linux with automatic patching and telemetry disabling

An Anime Team 8 Apr 23, 2023
The Honkers Railway launcher for Linux with automatic patching and telemetry disabling

The Honkers Railway launcher for Linux with automatic patching and telemetry disabling

An Anime Team 73 May 9, 2023
A command-line shell like fish, but POSIX compatible.

A command-line shell like fish, but POSIX compatible.

Seiya Nuta 813 Dec 29, 2022
Application microframework with command-line option parsing, configuration, error handling, logging, and shell interactions

Abscissa is a microframework for building Rust applications (either CLI tools or network/web services), aiming to provide a large number of features w

iqlusion 524 Dec 26, 2022