Skip to content

Conversation

@derdanu
Copy link
Collaborator

@derdanu derdanu commented Dec 2, 2025

Description

New document format for easier readability by creating a table for all CLI switches.

Type of Change

  • Bug fix
  • New feature
  • Documentation update required
  • Code quality improvement
  • Other (describe):

Markdown formatter for Github Wiki.

How Has This Been Tested?

./azcopy doc --format wiki
INFO: GitHub Wiki documentation generated in: ./doc

Copy link
Contributor

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 wiki format option to the azcopy doc command, enabling automatic generation of GitHub Wiki-style documentation with improved readability through structured tables for CLI switches and flags.

Key Changes:

  • Introduced --format wiki flag to generate GitHub Wiki-compatible markdown documentation
  • Implemented table-based format for flags with columns for name, type, default value, and description
  • Updated CI workflow to use the new wiki format for automated documentation updates

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
cmd/docWiki.go New file implementing WikiGenerator with command and flag info extraction, markdown table generation, and template-based rendering
cmd/doc.go Added format flag with "wiki" and "default" options; integrated WikiGenerator for wiki format
.github/workflows/update-wiki-docs.yml Updated to use --format wiki flag in documentation generation step

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

filename := filepath.Join(g.OutputDir, commandToWikiFilename(cmd)+".md")
return os.WriteFile(filename, buf.Bytes(), 0644)
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File permissions 0644 allow world-readable access. Consider using 0600 or 0640 to restrict read access to owner/group only, especially since these files may be written to arbitrary locations specified by user input.

Suggested change
return os.WriteFile(filename, buf.Bytes(), 0644)
return os.WriteFile(filename, buf.Bytes(), 0600)

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]>
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