Skip to content

[WiP] config file support - #38

Open
szborows wants to merge 4 commits into
masterfrom
config
Open

[WiP] config file support#38
szborows wants to merge 4 commits into
masterfrom
config

Conversation

@szborows

Copy link
Copy Markdown
Owner

No description provided.

@codecov-io

codecov-io commented Nov 13, 2016

Copy link
Copy Markdown

Current coverage is 92.07% (diff: 100%)

Merging #38 into master will not change coverage

@@             master        #38   diff @@
==========================================
  Files            11         11          
  Lines           164        164          
  Methods          57         57          
  Messages          0          0          
  Branches         18         18          
==========================================
  Hits            151        151          
  Misses            0          0          
  Partials         13         13          

Powered by Codecov. Last update 80a8bfb...e2f917b

Comment thread src/main.cpp

static auto readConfiguration() {
passwd *pw = getpwuid(getuid());
std::string const configFile = std::string{pw->pw_dir} + "/.yebash.cfg";

@Mrokkk Mrokkk Nov 14, 2016

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Well, for me this yebash.cfg looks too much DOS/Windows-ish ;)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

it's simple enough and does the job. do we have any alternatives?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I mean only that the .yebash.cfg name reminds me old Windows configuration files naming convention. I would rather choose .yebashrc as it's quite Unix-ish ;) Yes, I know I'm nitpicking ;)

Comment thread CMakeLists.txt
add_subdirectory(test)
install(FILES bin/yebash DESTINATION bin PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
else()
message(FATAL "Boost not found")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should be FATAL_ERROR

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

ok

Comment thread src/CMakeLists.txt

add_library(${PROJECT_NAME} SHARED ${SOURCES})
target_link_libraries(${PROJECT_NAME} -ldl)
target_link_libraries(${PROJECT_NAME} -ldl ${Boost_LIBRARIES})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Property Tree is a header-only library, so you don't need to link yebash with Boost libs

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

yes I know, I added it in case we will use any other Boost lib in future. i'll remove it, though

Comment thread CMakeLists.txt
find_package(Boost)

install(FILES bin/yebash DESTINATION bin PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
if(Boost_FOUND)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would rather write if(NOT Boost_FOUND) \n message(FATAL_ERROR ...) ...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

ok

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.

3 participants