Commit Graph

58 Commits

Author SHA1 Message Date
Neil Macneale IV
49e0cb67e7 Reverts to some changes in PR 2024-08-20 15:49:23 -07:00
Dylan Varga
fed30c181d Fixed grammar typos re issue #8221 2024-08-09 22:24:19 -07:00
Stephanie You
cdfabd2876 PR feedback 2023-08-29 14:35:24 -07:00
Stephanie You
392581fc8f make NO_POSITIONAL_ARGS a constant 2023-08-25 16:25:51 -07:00
Stephanie You
735837fc3a update dolt log to support tables separator (--) 2023-08-23 10:53:59 -07:00
Jason Fulghum
5514c1dce3 Fix for https://github.com/dolthub/dolt/issues/6001 2023-07-20 15:19:28 -07:00
Neil Macneale IV
f32fc4699a PR Feedack addressed 2023-06-23 09:51:52 -07:00
Neil Macneale IV
cd0cf8f9a4 Add ability to drop values from ArgParserResults 2023-06-16 15:56:11 -07:00
Nick Tobey
72f0dc2bad Add clarifying comment to ParseGlobalArgs 2023-05-23 12:28:53 -07:00
Nick Tobey
a1b2a38f47 Use more meaningful variable names. 2023-05-23 12:21:19 -07:00
Nick Tobey
edc5528ace Replace global arg parser. 2023-05-22 16:13:11 -07:00
Neil Macneale IV
2dd8ad68f9 Update Go tests to use CliContext with an SqlEngine 2023-05-05 11:46:47 -07:00
Nick Tobey
fe47616684 Add unit test for too many arguments passed to ArgParser. 2023-04-19 11:37:36 -07:00
Nick Tobey
43aee5f4d1 Update Name field in ArgParser. 2023-04-19 11:37:18 -07:00
Nick Tobey
f86c44db47 Add docstrings for NewArgParser... functions. 2023-04-19 11:36:48 -07:00
Nick Tobey
ebcaabc5b4 Rename ArgParser.TooManyArgsError to TooManyArgsErrorFunc 2023-04-19 11:36:18 -07:00
Nick Tobey
c0a8cb33d2 Fix typo in parser.go error string. 2023-04-18 11:49:35 -07:00
Nick Tobey
19ef9a1d21 ArgParser now takes the name of the command being parsed.
This allows us to print the command name in error messages and disambiguate cases where `dolt_sql` calls a procedure that corresponds to another dolt command.
2023-04-18 11:45:58 -07:00
Nick Tobey
6b2bec33b3 Allow any number of arguments when MaxArgs is set to -1. 2023-04-14 15:23:54 -07:00
Nick Tobey
b6abad268b Allow commands to specify a more helpful error message when too many args are passed. 2023-04-14 14:45:11 -07:00
Nick Tobey
9fad10d8fe Replace argparser.NewArgParser with NewArgParserWithMaxArgs and NewArgParserWithVariableArgs
This requires commands to specify the max number of positional arguments they expect.
This makes it harder to accidentally accept extra arguments and ignore them.
2023-04-14 10:18:33 -07:00
JCPrice0024
e04d4d8422 found another minor bug in results.go
Documented behavior
2022-12-05 17:34:37 -05:00
Jason Fulghum
09ec939a10 Updating test name 2022-11-30 13:14:13 -08:00
Jason Fulghum
6f3f182296 Removing newline 2022-11-30 10:29:33 -08:00
Tan Yong Zhi
a3d471612e Swap long and short form flag behavior 2022-11-30 13:43:37 +08:00
Tan Yong Zhi
67566b8898 Fix tests 2022-11-29 19:49:18 +08:00
Tan Yong Zhi
f654cee95d Fix value being read in param suffix 2022-11-29 17:26:06 +08:00
Zach Musgrave
04dec6e54c Added alias for renamed option 2022-11-14 15:23:22 -08:00
Taylor Bantle
f7246f854b Supply multiple refs to --not 2022-11-02 13:39:38 -07:00
jennifersp
f42712b240 allow optional empty value for string value for arg parsing (#4093)
* arg value should allow optional empty value

* fix godocs
2022-08-15 20:05:44 -07:00
Maximilian Hoffman
9a7a49f516 initial dolt backup cli (#2208)
* prototype

* backup pushes noms root

* backup pushes root value, basic restore still needs origin drop

* bats tests, no origin on restore, only head ref on restore

* cleanup code, up to date bats test

* make backup restore a root sync also, to catch branches and remote refs

* [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh

* couple of tim's comments

couple of tim's comments

* zach's comments

* loosen restrictions for conflicting remote addresses

* [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh

Co-authored-by: max-hoffman <max-hoffman@users.noreply.github.com>
2021-10-04 11:53:05 -07:00
Aaron Son
84c3066348 go/**/*.go: Update copyright headers for company name change. 2020-11-02 10:17:02 -08:00
Daylon Wilkins
b5bb663233 Reference new org name and updated trigger logic 2020-09-25 15:35:04 -07:00
Andy Arthur
a17914549d ugh parsing 2020-05-21 16:56:27 -05:00
Andy Arthur
7286431588 fixed help flag 2020-05-21 15:52:21 -05:00
Andy Arthur
c52d3bdc54 repo fmt 2020-05-21 14:59:35 -05:00
Andy Arthur
48533f66e4 updated parsing 2020-05-21 14:43:59 -05:00
Andy Arthur
b1cecda946 updated tests 2020-05-21 14:43:49 -05:00
Andy Arthur
85e94a2d7f better arg parsing 2020-05-20 18:16:34 -05:00
Andy Arthur
75b1044723 updated tests 2020-05-20 16:27:26 -05:00
Andy Arthur
f6ddadaa63 first pass at schema inferrence with typeinfo 2020-05-13 10:18:31 -07:00
Brian Hendriks
c8436c1721 Help Fix (#576) 2020-04-14 13:18:27 -07:00
Brian Hendriks
e3d42d5ee5 Multi DB (#517) 2020-04-09 15:07:52 -07:00
Brian Hendriks
7d89aec0d2 dumps docs (#301)
* refactor commands
* dump docs
2020-01-20 23:46:36 -08:00
Katie McCulloch
e609fa2bf7 dolt_docs feature branch (#222)
* Add Notes struct and some helper functions

* go/libraries/doltcore/env: Add Notes paths and create README and LICENSE on dolt init

* bats/no-repo.bats: Check that readme and license are created on init

* go/libraries/doltcore/env/notes.go: Let Notes key/val pairs be a map[string]string

* go/libraries/doltcore: Store notes on RootValue

* added license and readme to dolt status; merge on already existing repos not working

* fix merge for existing repos by using existing rootvals when notesMap is nil

* go/{cmd,libraries}: Use Doc instead of Note

* go/{cmd,libraries}: Move dolt docs to tableMap

* go/{cmd, libraries}: Get rid of abbreviation of Doc

* bats: Add comments for test where we rm LICENSE and README

* go/cmd/dolt/commands/status: Transform errors on  to get rid of panics

* go/libraries/dolctore/doltdb/root_val: Extract duplicate code in DocDiff to helper function

* go/libraries/doltcore: NewDocDiffs and root.DocDiff to take a slice of docs, easier to add docs in the future

* go/libraries/doltcore/env: Make Doc related env/path functions more general purpose that take in file name

* go/libraries/doltcore/actions: gofmt errors.go and minor update to defining docDetails

* go/libraries/doltcore/env/environment.go: Add PutDocsToWorking function

* go: Add docs to 'dolt add .' and update 'dolt status' to include staged docs

* bats: Add dolt doc tests and update comments where we rm <doc>

* go/libraries/doltcore/env/environment.go: Add generic functions to retrieve all or one valid docDetail(s)

* go: Pass specific docDetails for  to staged one PK at a time

* bats/dolt-docs.bats: dolt add <doc> for LICENSE.md and README.md

* bats/dolt-docs.bats: Remove fragile tests using  and use  instead

* go/libraries/doltcore: Break DocDiffs into helper functions and remove dereference to NewerText

* go/libraries/doltcore/env/environment: Extract updateExistingDocs and createDocsTable helper functions

* go/libraries/doltcore: Add RemoveDocsFromWorking so we unstage docs if stageTables encounters an error

* {bats,go}: Add test for adding invalid <table|doc>, simplify GetDocDiffs, and use PutDocsToWorking directly

* go/{cmd,libraries}: Implement dolt reset --hard, refactor dolt_docs.go env file for general use

* bats/dolt-docs.bats: Add dolt reset --hard tests for docs

* go/{cmd,libraries}: Implement soft reset for docs, make doltcore/env doc functions more general use

* bats/dolt-docs.bats: Add test coverage for soft reset of docs

* go/libraries/doltcore/env/environment.go: Extract PutDocsAndGetNewRoot function from PutDocsToWorking/PutDocsToStaged and use it in those functions

* {bats,go/cmd/dolt/commands/diff.go}: Add docs to working root before diffing, update tests

* {bats,go}: Print doc diffs

* {go,bats}: Print lines for deleted doc, and simplify doc diff printing

* Comitting output of ./Godeps/update.sh that was giving me error in ./Godeps/verify.sh

* {bats, go/libraries/doltcore/sqle/database.go: Remove DocTableName from sql commands

* go/{cmd,libraries}: Declare DoltNamespace and add HasDoltPrefix and FilterDoltInternalTables

* {go,bats}: Implement dolt diff <dic> by parsing docs from args, with bats test

* {go,bats}: Fix bug from commit #7b15ae8201083cbee57 that did not print deleted staged docs correctly

* rename docs test file: bats/dolt-docs.bats --> docs.bats

* go/{cmd,libraries/doltcore/env}: Implement dolt checkout <doc>

* bats/docs.bats: Add tests for dolt checkout <doc>

* Added test for branch, merge, and conflicts for dolt docs

* Actually Fixed weird space issue

* {go,bats}: Return error for dolt table *, schema *, ls, add, diff and reset command arguments that contain doltdb.DocTableName, with tests

* go/{cmd,libraries}: Remove pointer from type Docs and refactor resetHard to work with the change

* bats: 2 more tests for checkout

* SaveTrackedDocs for checkout, merge; still one skipped bats test

* go/{cmd,libraries}: Clean up doc checkout

* Simplify bats test docs.bats

* bats/docs.bats: simplify testing

* go/libraries/doltcore/doltdb/root_val_test.go: TestAddNewerTextAndValueToDocFromTbl

* go/libraries/dotlcore/doltdb/root_val: TestAddNewerTextAndDocPkFromRow

* simplify bats tests; remove run/status check where it is unneccesary

* Simplify bats test docs.bats

* libraries/doltcore/doltdb/root_val_test: TestDocDiff

* bats/docs.bats: Add newlines and notes to long test, remove comment

* {go,bats}: Stage tables and docs after successful merge with auto resolved conflicts

* go,{cmd,libraries}: Catch errors, return helpful doc error for checkout, add a comment

* cmd/dotl/commands/cnfcmds/resolve.go: Save docs in autoResolve and manualResolve instead of Resolve command function

* go/{cmd,libraries}: Refactor Checkout to handle docs explicitly

* bats/docs.bats: Add test coverage for checkout doc bug; still not working

* go/cmd/dolt/commands/status.go: Extract methods for retrieving lines of added, modified and removed not staged tbls and docs

* go: Move functions that Save docs to actions/docs.go

* go/cmd/dolt/commands/reset.go: Simplify RemoveDocsTbl helper fxn

* go/libraries/dotlcore/env/dolt_Docs.go: Use fs instead of os

* go/{cmd,libraries}: Simplify GetTblsDocsAndRootsForCheckout and add function comment

* gofmt-w

* go/{cmd,libraries}: Only use localDocs in actions/docs.go, and save docs where root has been updated

* go/cmd/dolt/commands/merge.go: Fail silently on updating staged root on merge

* go/cmd/dolt/commands: Move docsInCnfOnRoot to commands/status.go where it is being used

* go/{cmd,libraries}: Only use localDocs in actions/docs.go, and save docs where root has been updated

* go/cmd/dolt/commands/merge.go: Fail silently on updating staged root on merge

* go/cmd/dolt/commands: Move docsInCnfOnRoot to commands/status.go where it is being used

* bats/docs.bats: Add more test coverage for checkout

* go/{cmd,libraries}: Refactor Checkout command

* go/cmd/dolt/commands/merge.go: Remove silent fail, print message

* go/libraries/doltcore/env: Fix error that was deleting both untracked docs when only one was checked out

* go/{cmd,libraries}: Refactor Checkout command

* go/cmd/dolt/commands/merge.go: Remove silent fail, print message

* go/libraries/doltcore/env: Fix error that was deleting both untracked docs when only one was checked out

* Remove HasDoltPrefix from 2 checks that break create-view tests

* go/cmd/dolt/commands/checkout.go: Use HandleVErrAndExitCode, fix error msg when  is present, remove unneccessary verr declaration

* go/cmd/dolt/commands/checkout.go: Rename functions, return ref (not ref.String()) from getRemoteBranchRef

* Extract helper fxn getTblNotExistError, return NewTblNotExistError with bad table info

* go/cmd/dolt/commands/merge.go: Save docs in merge functions where roots are updated, add comment for UpdatedStagedWithVErr

* go/libraries/doltcore/env/actions: Move getupdatedWorkingAndStagedWithDocs to actions/docs.go

* Declare ctx := context.Background() at top of tests, use ctx throughout test

* Small improvement to AddValueToDocFromTbl, add comments to root_val_teset

* go/cmd/dolt/commands/checkout.go: Return verbose error rather than set variable and return later

* go/cmd/dolt/commands/checkout.go: Return verbose error from helper fxns in commands/checkout.go

* go/libraries/doltcore/env/actions/table.go: Remove err declaration from return params, declare err inline instead

* go/libraries/doltcore/env/actions/tables.go: Rename getTblNotExistError to validateTablesExist

Co-authored-by: Tim Sehn <tim@liquidata.co>
2020-01-17 10:50:15 -08:00
Matt Jesuele
d2f5d9a592 go/libraries/utils/argparser/parser.go: Clean up Parse and fix handling of -- passed as commit spec 2019-10-24 13:58:32 -07:00
Aaron Son
5fc6fd5d6a go: Update for dolt at root of repository. 2019-07-24 10:28:54 -07:00
Aaron Son
23a0f5a33e Merge remote-tracking branch 'origin/master' into aaron/dolt-3pdeps-license-fetching 2019-07-23 16:07:50 -07:00
Aaron Son
6619700b5a dolt/go: Add utils/repofmt/check_fmt.sh, and standardize goimports config across repository. 2019-07-23 11:59:06 -07:00
Aaron Son
732086a9c7 dolt/go: Add copyright notices to every file. For files from noms, retain and reference the previous copyright notice as well. 2019-07-22 17:06:35 -07:00