Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag: --sqldb #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

add flag: --sqldb #16

wants to merge 2 commits into from

Conversation

kindy
Copy link

@kindy kindy commented Apr 11, 2024

shotizam --sqldb bin-size.db /some/go.binary

then I can drag the db file to https://observablehq.com/@kindy/shotizam-viz and write sql there

:)

shotizam.go Outdated
@@ -31,6 +31,7 @@ var (
base = flag.String("base", "", "base file to diff from; must be in json format")
mode = flag.String("mode", "sql", "output mode; tsv, json, sql, nameinfo")
sqlite = flag.Bool("sqlite", false, "launch SQLite on data (when true, mode flag is ignored)")
sqldb = flag.String("sqldb", "", "save SQLite db (when set, mode and sqlite flag is ignored)")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as written, this sounds like a boolean flag. specify that this is the target filename to write the DB to?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradfitz yep, it's the target db filename.

how about -o filename, then we can use it like this:

shotizam --sqlite   -o bin-size.db  /some/go.binary
shotizam --mode csv -o bin-size.csv /some/go.binary
shotizam --mode sql -o bin-size.sql /some/go.binary

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working on it..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's ready.

btw --mode nameinfo also support -o

shotizam --sqlite -o bin-size.db   SELF
shotizam --mode nameinfo -o bin-size.txt SELF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants