Skip to content

Conversation

@nfisher1226
Copy link

Ref issue #8

Implements nologin command. Feedback welcome, this is my first PR to this org.

@cakebaker cakebaker linked an issue Feb 13, 2025 that may be closed by this pull request
@cakebaker
Copy link
Contributor

Can you please run cargo fmt?

@nfisher1226
Copy link
Author

Done, sorry that was a basic error.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of this file?

Copy link
Author

Choose a reason for hiding this comment

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

That was an intermediate file I didn't delete and accidentally committed (I think).

@sylvestre sylvestre requested a review from Copilot March 22, 2025 09:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new "nologin" command to politely refuse a login, addressing issue #8.

  • Introduces a new Cargo.toml and source files for the nologin command
  • Implements the command logic using clap for argument parsing and uucore for utilities
  • Updates the workspace Cargo.toml to include the new command in the feat_common_core list

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/uu/nologin/Cargo.toml New package metadata for the nologin command
src/uu/nologin/src/nologin.rs Command implementation using clap and uucore, including argument parsing
src/uu/nologin/nologin.md Documentation for the nologin command
Cargo.toml Workspace updated to include the nologin command
src/uu/nologin/src/main.rs Entry point for the nologin command

set_exit_code(1);

let args: Vec<OsString> = args.collect();
if args.len() > 2 {
Copy link

Copilot AI Mar 22, 2025

Choose a reason for hiding this comment

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

The condition for extra arguments simply returns Ok() without any feedback to the user. Consider adding an error message or usage info instead of silently exiting.

Suggested change
if args.len() > 2 {
if args.len() > 2 {
writeln!(std::io::stderr(), "Error: too many arguments")?;
writeln!(std::io::stderr(), "Usage: {}", USAGE)?;

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

ping ? :)

@oech3
Copy link

oech3 commented Nov 20, 2025

Inactive PR?

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.

Implement nologin

4 participants