Git Product home page Git Product logo

urlencode's Introduction

urlencode

A simple command line utility for URL encoding or decoding stdin. Urlencode doesn't have depencencies and aims to be available on every achitecture.

We currently build for:

  • Linux
    • x86_64(musl)
    • aarch64 (musl, gnu)
    • armv7 (gnueabihf, musleabihf)
    • arm (gnueabihf, musleabihf)
  • MacOs
    • Apple Silicon
    • Intel
  • Windows
    • x86_64

Installation

Download and Install the binary

$ curl -L YOUR_RELEASE_URL_FROM_GITHUB.tar.gz  -o urlencode.tar.gz
$ tar -xf urlencode.tar.gz
# The following will make the command be globally available in your system
$ mv urlencode /usr/local/bin

Build it yourself

To install urlencode, clone this repository and build the executable using Cargo:

git clone https://github.com/your-username/urlencode
cd urlencode
cargo build --release

Usage

To encode the input, pass it to urlencode as stdin:

$ echo "Hello World\!" | urlencode
# Output: "Hello%20World%21%0A"   <--- Please note the %0A at the end of the line, 
#                                      this is because "echo" withouth any flags 
#                                      will output a new line at the end of the string
$ echo -n "Hello World\!" | urlencode
# Output: "Hello%20World%21"

To decode the input, use the -d or --decode flag:

$ echo "Hello%20World%21" | urlencode -d
# Output: "Hello World!"

No-newline

The --nonewline flag tells urlencode to avoid adding a new line at the end of the string. This is the same behavior of the echo command, and preserves the output even it's chained multiple times inside urlencode.

$ echo -n "TEST AAAABBBB" | urlencode | urlencode | urlencode
# Output TEST%252520AAAABBBB%250A%0A <-- previous new lines get urlencoded as well 

$ echo -n "TEST AAAABBBB" | urlencode -n | urlencode -n | urlencode -n 
# Output: TEST%252520AAAABBBB  <-- no new line

List of all the commands

$ urlencode --help
A simple command line utility for URL encoding or decoding stdin.

Usage: urlencode [OPTIONS] [TEXT_TO_PARSE]

Arguments:
  [TEXT_TO_PARSE]  Text to parse, this parameter overrides stdin

Options:
  -d, --decode     Decode stdin instead of encoding
  -n, --nonewline  Do not append a newline to the output
  -h, --help       Print help information
  -V, --version    Print version information

Contributors wanted

This project is only at the beginning, feedback and help is always appreciated.
Feel free to submit pull requests.
Thank you in advance!

License

urlencode is licensed under the MIT license. See LICENSE for more details.

urlencode's People

Contributors

michaelcereda avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.