aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/search_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-12 01:01:35 +0900
committernsfisis <nsfisis@gmail.com>2026-06-12 01:01:43 +0900
commit1e44f5723e4c0e0903d00a61f254901e612fe5e1 (patch)
tree9c2e1eec364bbf6418a4072ee7767b04c3df0297 /crates/shirabe/src/command/search_command.rs
parentddf0a624145b618c05c2ee47414545b99b685f37 (diff)
downloadphp-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.gz
php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.zst
php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.zip
feat(symfony-console): port Symfony Console and make the workspace compile
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/search_command.rs')
-rw-r--r--crates/shirabe/src/command/search_command.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/shirabe/src/command/search_command.rs b/crates/shirabe/src/command/search_command.rs
index b9eacf5..b2fb1df 100644
--- a/crates/shirabe/src/command/search_command.rs
+++ b/crates/shirabe/src/command/search_command.rs
@@ -53,7 +53,7 @@ impl SearchCommand {
let format = input
.borrow()
- .get_option("format")
+ .get_option("format")?
.as_string()
.map(|s| s.to_string())
.unwrap_or_else(|| "text".to_string());
@@ -109,13 +109,13 @@ impl SearchCommand {
let mut mode: i64 = repository_interface::SEARCH_FULLTEXT;
if input
.borrow()
- .get_option("only-name")
+ .get_option("only-name")?
.as_bool()
.unwrap_or(false)
{
if input
.borrow()
- .get_option("only-vendor")
+ .get_option("only-vendor")?
.as_bool()
.unwrap_or(false)
{
@@ -128,7 +128,7 @@ impl SearchCommand {
mode = repository_interface::SEARCH_NAME;
} else if input
.borrow()
- .get_option("only-vendor")
+ .get_option("only-vendor")?
.as_bool()
.unwrap_or(false)
{
@@ -137,11 +137,11 @@ impl SearchCommand {
let r#type = input
.borrow()
- .get_option("type")
+ .get_option("type")?
.as_string()
.map(|s| s.to_string());
- let tokens_arg = input.borrow().get_argument("tokens");
+ let tokens_arg = input.borrow().get_argument("tokens")?;
let token_strings: Vec<String> = tokens_arg
.as_array()
.map(|arr| {
@@ -182,7 +182,7 @@ impl SearchCommand {
if let Some(link) = link {
io.write(&format!(
"<href={}>{}</>{}{}{}",
- OutputFormatter::escape(link),
+ OutputFormatter::escape(link)?,
result.name,
" ".repeat(name_length as usize - result.name.len()),
warning,