Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements around forc plugins command #1969

Merged
merged 3 commits into from
Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions forc/src/cli/commands/plugins.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::cli::PluginsCommand;
use anyhow::{anyhow, Result};
use clap::Parser;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use tracing::info;

/// Find all forc plugins available via `PATH`.
Expand Down Expand Up @@ -32,9 +32,9 @@ pub(crate) fn exec(command: PluginsCommand) -> Result<()> {

/// Find a plugin's description
///
/// Given a plugin name, returns the description included in the `-h` opt. Returns
/// a generic description if a description cannot be found
fn parse_description_for_plugin(plugin: &str) -> String {
/// Given a cannonical plugin path, returns the description included in the `-h` opt.
/// Returns a generic description if a description cannot be found
fn parse_description_for_plugin(plugin: &Path) -> String {
use std::process::Command;
let default_description = "No description found for this plugin.";
let proc = Command::new(plugin)
Expand Down Expand Up @@ -78,7 +78,7 @@ fn format_print_description(
.to_string()
};

let description = parse_description_for_plugin(&display);
let description = parse_description_for_plugin(&path);

if describe {
Ok(format!(" {} \t\t{}", display, description))
Expand Down