mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
cli: Rename "raw" output mode to "list"
Change the name of the output mode to match SQLite.
This commit is contained in:
10
cli/app.rs
10
cli/app.rs
@@ -27,7 +27,7 @@ pub struct Opts {
|
||||
pub database: Option<PathBuf>,
|
||||
#[clap(index = 2, help = "Optional SQL command to execute")]
|
||||
pub sql: Option<String>,
|
||||
#[clap(short = 'm', long, default_value_t = OutputMode::Raw)]
|
||||
#[clap(short = 'm', long, default_value_t = OutputMode::List)]
|
||||
pub output_mode: OutputMode,
|
||||
#[clap(short, long, default_value = "")]
|
||||
pub output: String,
|
||||
@@ -73,7 +73,7 @@ pub enum Command {
|
||||
Cwd,
|
||||
/// Display information about settings
|
||||
ShowInfo,
|
||||
/// Set the value of NULL to be printed in 'raw' mode
|
||||
/// Set the value of NULL to be printed in 'list' mode
|
||||
NullValue,
|
||||
/// Toggle 'echo' mode to repeat commands before execution
|
||||
Echo,
|
||||
@@ -117,7 +117,7 @@ impl Command {
|
||||
Self::Help => ".help",
|
||||
Self::Schema => ".schema ?<table>?",
|
||||
Self::Opcodes => ".opcodes",
|
||||
Self::OutputMode => ".mode raw|pretty",
|
||||
Self::OutputMode => ".mode list|pretty",
|
||||
Self::SetOutput => ".output ?file?",
|
||||
Self::Cwd => ".cd <directory>",
|
||||
Self::ShowInfo => ".show",
|
||||
@@ -398,7 +398,7 @@ impl<'a> Limbo<'a> {
|
||||
Ok(file) => {
|
||||
self.writer = Box::new(file);
|
||||
self.opts.is_stdout = false;
|
||||
self.opts.output_mode = OutputMode::Raw;
|
||||
self.opts.output_mode = OutputMode::List;
|
||||
self.opts.output_filename = path.to_string();
|
||||
Ok(())
|
||||
}
|
||||
@@ -636,7 +636,7 @@ impl<'a> Limbo<'a> {
|
||||
) -> anyhow::Result<()> {
|
||||
match output {
|
||||
Ok(Some(ref mut rows)) => match self.opts.output_mode {
|
||||
OutputMode::Raw => loop {
|
||||
OutputMode::List => loop {
|
||||
if self.interrupt_count.load(Ordering::SeqCst) > 0 {
|
||||
println!("Query interrupted.");
|
||||
return Ok(());
|
||||
|
||||
@@ -44,7 +44,7 @@ impl Default for Io {
|
||||
|
||||
#[derive(ValueEnum, Copy, Clone, Debug, PartialEq, Eq)]
|
||||
pub enum OutputMode {
|
||||
Raw,
|
||||
List,
|
||||
Pretty,
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ Special Commands:
|
||||
.quit Stop interpreting input stream and exit.
|
||||
.show Display current settings.
|
||||
.open <database_file> Open and connect to a database file.
|
||||
.output <mode> Change the output mode. Available modes are 'raw' and 'pretty'.
|
||||
.mode <mode> Change the output mode. Available modes are 'list' and 'pretty'.
|
||||
.schema <table_name> Show the schema of the specified table.
|
||||
.tables <pattern> List names of tables matching LIKE pattern TABLE
|
||||
.opcodes Display all the opcodes defined by the virtual machine
|
||||
|
||||
Reference in New Issue
Block a user