这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@tcely
Copy link

@tcely tcely commented Apr 26, 2025

No description provided.

- Document `DAEMON_STOP_SIGNAL`
- Start in `${XDG_RUNTIME_DIR}`
- Use `case` to print the proper message 
- Remove an unused local variable
service-daemon Outdated
echo "."
(restart) printf -- 'Restart' ;;
(start) printf -- 'Start' ;;
(stop) printf -- 'Stopp' ;;
Copy link
Member

Choose a reason for hiding this comment

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

This is still harming the readability of this code.
I do not see a benefit is keeping this printout DRY to such an extent.

I'm also kind of surprised to see that the enclosed parentheses form for case labels is part of the POSIX sh spec.
But I did check it in the documentation.

Copy link
Author

Choose a reason for hiding this comment

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

I think the new function is good balance between duplicating in every case and the extent the previous version went to.

Let me know if you have a better way to maintain readability without duplicated messages for every case.

The open parentheses always look odd to me, so when I learned about the closed form, I was happy to start using that way instead.

"${cmd}"
done
printf -- '.\n'
}
Copy link
Member

Choose a reason for hiding this comment

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

I still think this is overkill but it's not worth arguing over.

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