cli: Rename "raw" output mode to "list"

Change the name of the output mode to match SQLite.
This commit is contained in:
Pekka Enberg
2025-02-17 21:26:15 +02:00
parent 97601658a9
commit caa83b347e
2 changed files with 7 additions and 7 deletions

View File

@@ -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(());

View File

@@ -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