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 support for documentation to just --list #2509

Open
JakeSummers opened this issue Dec 7, 2024 · 1 comment
Open

Add support for documentation to just --list #2509

JakeSummers opened this issue Dec 7, 2024 · 1 comment

Comments

@JakeSummers
Copy link

This tool looks awesome! Nice work.

One of the things that this tool is lacking right now is the ability to add documentation to tasks.

This is the pattern that I use in make:

image

The implementation of this is a terrible hack:

#===============================================
## Help

## Display this message
help:
	@printf "\033[1mUsage\033[0m\n"
	@awk '{ \
			if ($$0 ~ /^.PHONY: [a-zA-Z\-\_0-9]+$$/) { \
				helpCommand = substr($$0, index($$0, ":") + 2); \
				if (helpMessage) { \
					printf "\033[36m%-30s\033[0m %s\n", \
						helpCommand, helpMessage; \
					helpMessage = ""; \
				} \
			} else if ($$0 ~ /^[a-zA-Z\-\_0-9.]+:/) { \
				helpCommand = substr($$0, 0, index($$0, ":")); \
				if (helpMessage) { \
					printf "\033[36m%-30s\033[0m %s\n", \
						helpCommand, helpMessage; \
					helpMessage = ""; \
				} \
			} else if ($$0 ~ /^##/) { \
				if (helpMessage) { \
					helpMessage = helpMessage"\n                               "substr($$0, 3); \
				} else { \
					helpMessage = substr($$0, 3); \
				} \
			} else { \
				if (helpMessage) { \
					printf "\n\033[3;35m>%s \033[0m\n", helpMessage \
				} \
				helpMessage = ""; \
			} \
		}' \
		$(MAKEFILE_LIST)

#===============================================
## Local Development

## Setup your local development environment
setup: poetry-install codegen

Would adding something like this be possible?

@laniakea64
Copy link
Contributor

just already has just -l, [group] attribute, and documentation comments / [doc] attribute. What other feature(s) would need to be added to achieve what you're seeking?

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

No branches or pull requests

2 participants