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

Working on the output strings #5

Merged
merged 6 commits into from
Feb 6, 2017
Merged

Working on the output strings #5

merged 6 commits into from
Feb 6, 2017

Conversation

nsomar
Copy link
Owner

@nsomar nsomar commented Feb 2, 2017

  • Adding colors using swiftline
  • Updating tests

Note:

  • Guaka-Generator vendors Swiftline for now. This will be resolved when we merge swiftline/linux! branch in swiftline.

cc @goyox86

@nsomar
Copy link
Owner Author

nsomar commented Feb 2, 2017

New command looks like this:

image

Add command:

image

Some Errors:

image

image

rm -rf SwiftLineTemp

@echo "Clone new Swiftline from oarrabi/linux! branch"
git clone -b oarrabi/linux! https://github.com/oarrabi/Swiftline.git SwiftLineTemp
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we commiting to maintaing this branch green. I think we shoudl use another name. Like 'vendored'.

Copy link
Owner Author

Choose a reason for hiding this comment

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

The branch in Swiftline is about making it work on linux nsomar/Swiftline#30

I think we should keep the name until we merge it

return [
"Wrong path given:",
" \(path)",
"The path cannot be used as its not empty"
Copy link
Collaborator

Choose a reason for hiding this comment

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

"The path must be an empty directory"

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

case .setupFileAltered:
return "Guaka setup.swift file has been altered.\nThe placeholder used to insert commands cannot be found \(GeneratorParts.comamndAddingPlaceholder).\nYou can try to add it yourself by updating `setup.swift` to look like\n\n\(GeneratorParts.setupFileContent())\n\nAdding command wont be possible."
return "Guaka setup.swift file has been altered.\nThe placeholder used to insert commands cannot be found \(GeneratorParts.comamndAddingPlaceholder).\nYou can try to add it yourself by updating `setup.swift` to look like\n\n\(GeneratorParts.setupFileContent())\n\nAdding command wont be possible.".f.red
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Adding command won't be possible"

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

case .notAGuakaProject:
return "This command can only be executed in a Guaka project.\nThe following directory does not contain guaka files"
return "This command can only be executed in a Guaka project.\nThe following directory does not contain guaka files".f.red
Copy link
Collaborator

Choose a reason for hiding this comment

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

"This command can only be executed inside a Guaka project." I think it's enough.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

case .missingCommandName:
return [
"`guaka add` requires a command that was not given.",
"`guaka add` requires a command that was not given.".f.red,
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Missing sub-command for guaka add"?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

"Call `guaka add CommandName` to create a new command.",
""
].joined(separator: "\n")

case .commandAlreadyExist(let name, let path):
return [ "The command name passed `\(name)` already exist:".f.red,
Copy link
Collaborator

Choose a reason for hiding this comment

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

"The command \(name) already exists:"

case .tooManyArgsPassed:
return "Too many arguments passed to command."
return "Too many arguments passed to command.".f.red
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we just ignore the extra args? Also we could say something like "Too many arguments. Trailing arguments will be ignored"

Copy link
Owner Author

Choose a reason for hiding this comment

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

Can we scope this out of this PR? I created #6 for that

@goyox86
Copy link
Collaborator

goyox86 commented Feb 6, 2017

👍

@nsomar nsomar merged commit 53cf6c7 into master Feb 6, 2017
@nsomar nsomar deleted the oarrabi/adding-colors branch February 6, 2017 20:42
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