This is a command-line interface (CLI) tool written in Go that calculates the factorial of a given integer.
To use the factorial CLI, follow the instructions below:
-
Clone the repository:
git clone [email protected]:wantaekchoi/factorial-go.git
-
Navigate to the project directory:
cd factorial-go
-
Build the CLI tool:
go build -v ./...
-
Run the CLI tool with the desired number and options:
./factorial-go -number <number> -base <base>
Replace
<number>
with the integer value for which you want to calculate the factorial. Replace<base>
with the desired number base for the input (default is 10).Examples:
-
Calculate the factorial of 5 (base 10):
./factorial-go -number 5
-
Calculate the factorial of FF (base 16):
./factorial-go -number FF -base 16
-
-
The factorial of the given number will be displayed.
The following options are available:
-number
,-n
: Integer value to calculate factorial (required).-base
,-b
: Number base for the input (default: 10).