Commit Graph

38 Commits (933fd8e8fe68d5cd368ac4af1ba3cf6b783d8fbd)

Author SHA1 Message Date
ch33hau 933fd8e8fe Prevent auth command with leading spaces writing to history 2016-10-08 02:45:22 +08:00
Michael Desa 1030306d3e Prevent writing auth command to influx_history 2016-10-06 09:30:04 -07:00
Jonathan A. Sternberg 35b7460ad3 Use consistent column output from the CLI for column formatted responses
There were three different outputs that could be output with columns
that were rather strange depending on if there was a name and if there
were tags with the response.

Normalized output now has the dashes always under the column names and
no dashes anywhere else for consistency.
2016-09-13 14:20:49 -05:00
Jack Zampolin 3a179982a6 Fixes issue #7141 2016-08-17 11:10:06 -04:00
Cory LaNou 8871f5bf8c update connection settings when changing hosts in cli 2016-07-08 11:35:42 -05:00
Jonathan A. Sternberg 1d20498273 Allow a non-admin to call "use" for the influx cli
Previously, a non-admin could not call "use" in the influx cli since the
`SHOW DATABASES` command requires admin permissions to run. The correct
solution to this is likely to allow non-admins to call `SHOW DATABASES`,
but only see the databases they should be capable of seeing.

Since we don't have this kind of fine-grained authorization yet and
plans for it are still in the works, we do need someway to not
arbitrarily cripple non-admins attempting to use the cli program. This
is a temporary solution that will ignore any authorization errors from
`SHOW DATABASES` if authorization has been set. A warning message will
be printed and the database will be switched. This should be enough to
ensure that there is some warning that you may not have switched to a
valid database while not crippling non-admin users.

A temporary solution for #6397.
2016-06-22 08:15:18 -05:00
Edd Robinson 1b5c6b75c2 Ensure client sends correct precision 2016-05-19 17:27:32 +01:00
Jonathan A. Sternberg 2ccbe26447 Fix the CLI not to enter an infinite loop when the liner has an error
This also removes the dependency on `os/user` and uses the `HOME`
environment variable which is more common on Linux and Mac OS X for
customizing the history file location.

Removing this import also lets the `influx` binary be cross-compiled as
`os/user` relies on cgo.
2016-04-28 08:35:54 -04:00
Edd Robinson 289fe5bfcb Don't catch SIGQUIT; safer close of Quit channel 2016-04-27 14:38:48 +01:00
Philip O Toole ed7229fa2d Make it clear when CLI version is unknown
This mimics the behavior of the database binary.
2016-04-22 21:35:42 -07:00
kun 82a4b5e7b1 fix cli writeColumns output 2016-04-22 18:25:14 +08:00
Jonathan A. Sternberg 42b68d915f Return a deprecated message when IF NOT EXISTS is used
The deprecated message is now attached to a new attribute returned with
the results. This message can then be read by clients to warn a user
about upcoming changes to the query engine.

The `influx` client has already been modified to read this message and
print it out for every format except CSV.

The first warning message is a deprecated message about removing `IF NOT
EXISTS` from `CREATE DATABASE`.

The message will also be printed to the server log.

Fixes #5707.
2016-04-15 09:17:59 -04:00
Edd Robinson 44911bc5d8 Use 'latest' alias for links to documentation
Includes a fix for #6280
2016-04-11 14:56:53 +01:00
Jonathan A. Sternberg 8752d1b1e3 Support chunked queries in the Go InfluxDB client
Modify the CLI to always use chunked queries.
2016-03-31 15:30:43 -04:00
Cory LaNou 27cfaa4b7a in memory meta, single node configs, etc. 2016-03-14 16:55:54 +00:00
Ross McDonald 51758cff25 Switched 0.9 references to 0.10. 2016-02-11 08:44:45 -06:00
Ben Johnson d9a6a7340f add canonical paths 2016-02-10 11:30:52 -07:00
Ben Johnson 5a0d1ab7c1 rename influxdb/influxdb to influxdata/influxdb
This commit changes all the import and URL references from:

    github.com/influxdb/influxdb

to:

    github.com/influxdata/influxdb
2016-02-10 10:26:18 -07:00
Jason Wilder d4ee1cb2b1 Merge pull request #5284 from mglazer/secure-cli
CLI Option to Connect without HTTPS Verifica…
2016-02-08 11:45:32 -07:00
Edward Robinson b8e42cdd3a Ensure non-interactive mode returns appropriate exit code
Fixes #5475.
2016-02-02 15:23:16 +00:00
Adam Svoboda 40e04d89fc Prevent exponential growth in ~/.influx_history
The history file is cleared before WriteHistory is called after each
command/exit() to prevent exponential file growth.

This commit addresses issue #5436, please see PR for full explanation.
2016-01-26 20:53:41 -06:00
Edd Robinson c6d32bd1bb Fix #5127 2016-01-07 22:30:46 +00:00
Jonathan A. Sternberg 6b546cb766 Remove calls of os.Exit from influx cli Run method and fix influx tests
One of the first unit tests in the cli tests called the Run method.
Since the Run method called os.Exit, it reported the unit tests as
succeeded. When parallel is set to 1, this skips _all_ unit tests after
the first one. When parallel is set to a higher value, unit tests run by
other processes still get run.

This changes the Run method to return an error (if one occurred). This
error can then be printed out and a bad exit status can be used to exit
the program from the main program instead.  That causes the unit tests
to run correctly regardless of how many parallel processes are running.

Also added an additional option to the CLI called `IgnoreSignals`. If
this is set to true, then signals are not registered with the process.
Setting signals doesn't really work in unit tests so it's good to ensure
they don't get set in the first place.

In addition to fixing the influx cli tests, this adds a mock client to
the cli test for Use. PR #5183 added a validation for `use` to only be
able to select public databases so `_internal` couldn't be chosen. To
implement this, the `SHOW DATABASES` command was used by the internal
client.

Some of the unit tests in `cli_test.go` don't set the client to
anything. `TestParseCommand_Use` previously didn't, but now it needs to
have a client in the unit test with an empty test server.
2015-12-29 14:58:54 -05:00
Mike Glazer c049ebfa43 Support connecting to InfluxDB with the client without HTTPS Verification
The V2 client code supports this, however, the V1 client code didn't,
and the argument to support this just had to be added to the CLI
2015-12-29 09:03:16 -08:00
Sebastian Borza 26bc778b40 adding quit and Ctrl-D support to influx cli
update comment based on feedback
2015-12-23 11:54:41 -05:00
Paulo Pires 3165c707fc Small improvements to USE command as per PR comments. 2015-12-22 08:55:32 +00:00
Paulo Pires 3f4949019d USE databasename will work only for existing databases. Fixes #5174 2015-12-21 09:34:40 +00:00
nick.grange 99f90770da Fixed code format using go fmt. 2015-12-18 00:28:58 +11:00
nick.grange 33de878956 Fixed #5078 to support Inserts in non-interactive mode.
Changed non-interactive mode to send everything through the CLI's parser the same way the interactive mode works.
Added multiline support for -execute flag.
2015-12-17 23:42:30 +11:00
Yin Jifeng 2f3fc70514 FIX #4279 CLI support multiline 2015-11-16 22:59:21 +08:00
Cory LaNou bb00645a84 Merge pull request #4768 from pires/4719-cli_history_refactor
CLI history skips blank lines.
2015-11-14 07:25:58 -06:00
Paulo Pires a8fa170f29 Removed bogus comment. 2015-11-14 11:12:31 +00:00
Anes Hasicic 95ced0bcc1 Changed help command output from inside the cli to
match the info provided by the influx --help output,
and added history command

Reverted description for pretty command

+ minor edits

Removed duplication of command names

Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
2015-11-13 09:41:51 +01:00
Paulo Pires 81658de1be Exit gracefully on forced CLI termination. 2015-11-12 23:14:36 +00:00
Paulo Pires c812aaa36b Refactored command parsing tokenization. 2015-11-12 20:52:41 +00:00
Paulo Pires 194b2c4965 CLI history skips blank lines.
Fixes #4719
2015-11-12 20:50:23 +00:00
Pablo Miranda b908cbb866 fix lint errors for cmd/...
corrects the initialize package comment for lint

brings c.ServerVersion back
2015-11-10 23:13:01 -08:00
Paulo Pires aa6f807dfe Move CLI stuff out of main package for increased testability. Refs #2313 2015-11-10 16:27:13 +00:00