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

Add command to list configuration options #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sosthene-nitrokey
Copy link

@sosthene-nitrokey sosthene-nitrokey commented Oct 3, 2024

Looks like this is enough to go make the binary size too big. What a shame.

sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 3, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 3, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 3, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 3, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 3, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 4, 2024
src/config.rs Show resolved Hide resolved
src/config.rs Outdated
@@ -163,6 +163,19 @@ pub trait Config: Default + PartialEq + DeserializeOwned + Serialize {
///
/// Return false if the configuration does not support storing the migration version
fn set_migration_version(&mut self, _version: u32) -> bool;

fn list_available_config(&self) -> &'static [ConfigField];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe just list_fields or fields for consistency with field and to be more concise?

src/admin.rs Outdated
@@ -69,6 +70,7 @@ enum Command {
FactoryReset,
#[cfg(feature = "factory-reset")]
FactoryResetApp,
ListAvailableConfig,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would just call it ListConfig/LIST_CONFIG to be less verbose, but that’s just a personal preference

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intuitively, ListConfig would also return the values for each config field.

sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 4, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 4, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 4, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 4, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 7, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 7, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 8, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 9, 2024
sosthene-nitrokey added a commit to Nitrokey/nitrokey-3-firmware that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants