-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: basic CLI program * chore: makefile cli targets * chore: add fmt targets for CLI * ci: add workflow to check fmt and build cli * style: cli fmt * refactor: fmt receive root_dir via param * docs: cli makefile targets * ci: rename cli workflow * ci: run workflows when related files are modified only * ci: update names
- Loading branch information
1 parent
eed4315
commit 2bee5ec
Showing
5 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "CLI" | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: ["*"] | ||
paths: | ||
- "cli/**" | ||
|
||
jobs: | ||
compile_and_test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Check format" | ||
run: make cli_check_fmt | ||
- name: "Compile" | ||
run: make cli_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <primitive-types/u256.h> | ||
|
||
int main(int argc, char **argv) { | ||
if (argc < 3) { | ||
printf("You must provide two decimal strings."); | ||
return 1; | ||
} | ||
|
||
u256 first = u256_from_dec_string(argv[1]); | ||
u256 second = u256_from_dec_string(argv[2]); | ||
|
||
u256_overflow_op res = u256_overflow_add(first, second); | ||
|
||
printf("RESULT:\n"); | ||
u256_println(res.res); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters