1
0
Fork
You've already forked phmod
0
Chmod Translater/Parser/Helper
  • Go 100%
Find a file
2020年05月17日 13:51:49 +01:00
chmodparse Implements char parsing. Removes unnecessary errors from parser 2020年05月01日 18:21:54 +01:00
go.mod Fleshes out NumParser 2020年04月19日 17:19:06 +01:00
go.sum Creates branching logic per argument type. Error format cleanup 2020年04月18日 15:56:56 +01:00
main.go Adds ParseVerbose. Fixes numParser field assignment 2020年04月23日 04:17:36 +01:00
parse.go Implements char parsing. Removes unnecessary errors from parser 2020年05月01日 18:21:54 +01:00
README.md Updates README 2020年05月17日 13:51:49 +01:00

phmod

phmod is a simple translator for chmod written in Go (1.14). Given an octal (771) or symbolic (rwxr-x--x) representation of a chmod input, phmod will produce its opposite with the option of some explanation using the -l flag.

Install

Run GO111MODULE=on go get github.com/PMcca/phmod to install the package to your $GOPATH/bin directory. Next run ln -s $GOPATH/bin/phmod /usr/local/bin/phmod to run it via your $PATH.

Usage

phmod [OPTION] <args>
Options:
--long, -l Prints the result in verbose, human-readable format.
--help, -h show help
--version, -v print the version

NOTE To give an input such as --xrwxrwx (that is, the argument starting with -), precede the argument with --. e.g.

phmod -- --xrwxrwx

Output: 177

Example

phmod 571 Output: r-xrwx--x

phmod -l r-xrwx--x Output:

User Modes:
RWX
101 = 5
Group Modes:
RWX
111 = 7
Other Modes:
RWX
001 = 1