Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

help: Copy the DEFAULT_OPTIONS object rather than directly adding to it #58

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/puter-shell/coreutils/coreutil_lib/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const DEFAULT_OPTIONS = {

export const printUsage = async (command, out, vars) => {
const { name, usage, description, args } = command;
const options = Object.assign(DEFAULT_OPTIONS, args.options);
const options = Object.create(DEFAULT_OPTIONS);
Object.assign(options, args.options);

const heading = text => {
out.write(`\x1B[34;1m${text}:\x1B[0m\n`);
Expand Down